Bug with toolbar pixmaps...




I wondered why the pixmaps of the toolbar of a friend's program showed
whith an incorrect offset and I found that it depends on the moment that
you show the app's window.

In another application, which has a very similar main function as the
following, I declare a gnome_canvas somewhere in between "Place 1" and
"Place 2", but gtk seems to be assigning an allocation of height 0 and the
canvas won't show up unless I show the main window at "Place 2". This
could be related to the toolbar bug.

Here is the code:

int main(int argc,char *argv[])
{
	GtkWidget *gpixmap;

	init_globals();
	
	/* Initializing Gnome */
	gnome_init ("gmoiss", NULL, argc, argv, 0, NULL);
	gmoiss_init_pixes();
	gmoiss_window = gnome_app_new("gmoiss", "gmoiss: Main");

/*  Place 1: If you use it here, no problema with toolbar, but canvas
    won't show. */
	gtk_widget_show_all (gmoiss_window);

	gtk_window_set_wmclass(GTK_WINDOW(gmoiss_window), "gmoiss",
			       "gmoiss");
	
	/* vbox */
	
	gmoiss_vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
	gtk_container_border_width (GTK_CONTAINER (gmoiss_vbox), 10);
	
	gpixmap = gnome_pixmap_new_from_xpm_d (weed_xpm);
	gtk_box_pack_start (GTK_BOX (gmoiss_vbox), gpixmap, FALSE, FALSE, 0);
	gtk_widget_show (gpixmap);
	
	gnome_app_set_contents(GNOME_APP(gmoiss_window), gmoiss_vbox);
	gnome_app_create_menus(GNOME_APP(gmoiss_window), mainmenu);
	gnome_app_create_toolbar(GNOME_APP(gmoiss_window), toolbar);
		
/*  Place 2: Do it here and the pixmaps of the toolbar will be fucked up,
    but the canvas will get its right size.
	gtk_widget_show_all (gmoiss_window); */
	
	gtk_main();
	
	return 0;
}




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