[Glade-users] widget-window in a non-callback function
- From: daniel at dieterle.ws (Daniel Dieterle)
- Subject: [Glade-users] widget-window in a non-callback function
- Date: Mon, 22 Oct 2007 14:02:07 +0200
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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]