Window size



Hi all,
I'm walking through gtk 1.2 doc since 1 or 2 hours and I can find a working 
way to set the size of a window.
gtk_window_set_geometry_hints don't works, gtk_window_set_default_size too. 
Have I misunderstanding something ?
(note the window is opened, but in something like 10x10)
Thanks a lot

Jylam



Here is my code :


void OpenWindow(int width, int height, unsigned char *title)
{
  MyWindow = (LnxWindow*) malloc(sizeof(LnxWindow));

	MyWindow->MyGeometry.base_width = width;
        MyWindow->MyGeometry.base_height = height;  

        gtk_init(NULL, NULL);         
        MyWindow->window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_default_size (GTK_WINDOW(MyWindow->window),            
        MyWindow->MyGeometry.base_width,  MyWindow->MyGeometry.base_height);
        gtk_window_set_geometry_hints (GTK_WINDOW(MyWindow->window), NULL,    
                                                       &MyWindow->MyGeometry, 
                                                       GDK_HINT_BASE_SIZE);
        gtk_window_set_title(GTK_WINDOW(MyWindow->window), title);
        gtk_signal_connect(GTK_OBJECT(MyWindow->window),  "destroy",          
        GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
        gtk_window_set_policy (GTK_WINDOW(MyWindow->window), FALSE, FALSE,    
                                           FALSE);
        gtk_widget_show((GtkWidget*)MyWindow->window);
        gdk_flush();

}







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]