[Glade-users] widget-window in a non-callback function

Daniel Dieterle daniel at dieterle.ws
Mon Oct 22 08:02:07 EDT 2007


Hi,

considere following example:

gboolean on_drawingarea_expose_event (GtkWidget *widget, ...)
{
	GdkGC * my_gc = gdk_gc_new (widget->window); /*new gc-context*/
...


Now i want to make the graphix staff in a seperate function, like this:

void my_function( void )
{
	GdkGC * my_gc = gdk_gc_new (widget->window); /*new gc-context*/
...


The problem is, that i don't know, how to access the "widget->window" in
a non-callback-function (where i have widget as parameter).
I tried something like this, but it doesn't work:

void my_function( void )
{
	GtkWidget * window_main = glade_xml_get_widget ("my_xml_file",
"the_main_window");
	GdkGC * my_gc = gdk_gc_new (window_main); /*new gc-context*/
...


Any hints?
Thanx,

Daniel D.



More information about the Glade-users mailing list