[Glade-devel] Libglade and setting colormaps on window

Tristan Van Berkom tvb at gnome.org
Fri Mar 30 17:31:23 EDT 2007


On Fri, 2007-03-30 at 14:26 -0700, 3saul wrote:
> Hello,
> 
> I'm creating a simple application using Anjuta 2.1.2 and Glade 3.20 (using
> libglade). I'm trying to set a colormap on the main window but am getting
> this error:
> 
> gtk errors "!GTK_WIDGET_REALIZED (widget) failed
> 
> The problem is is that when I check to see if window is in fact realized
> with
> 
> if (GTK_WIDGET_REALIZED(window))
> 	{
>     	printf ("It's realized for gods' sake!");
> 	}
> 
> It returns true. Everything else works as expected. The window displays on
> the screen etc.

You need to set that up after creating the window and before displaying
it, if the toplevel's visible attribute is TRUE, then it will already
be realized and thus its too late.

Set the toplevel window to be invisible, setup your colormap after
glade_xml_new(); and before gtk_widget_show (toplevel).

Cheers,
              -Tristan





More information about the Glade-devel mailing list