Re: Is it possible to attach signalhandler to a GdkWindow?



A GtkWindow is a decendant of a GtkObject, so it
works with a GtkWindow...but a GdkWindow is a totally
different thing, as it's a simple window id, not a widget.
Did you really create just a GdkWindow?  If you do,
you're working at just the GDK level, which seems fine
when you're doing the drawing as those are all
GDK calls, but you're losing all the widget interactions
because they are at the GTK level (and you don't get
the signal_connect()!).   Do you do the
gtk_init() and all?  If so, I think using a drawing area
is actually quite simple, and then the drawing you're doing
stays the same.  You create a drawing area widget of the
same size as  your GdkWindow, and you just use it's
window id in your drawing functions.

Basically, I think you should look at the scribble example in the
tutorial, and see if that helps.....
Donna

----- Original Message -----
From: Kent Nyberg <blurkis bonbon net>
To: <gtk-app-devel-list gnome org>
Sent: Tuesday, January 23, 2001 12:36 PM
Subject: Is it possible to attach signalhandler to a GdkWindow?


I have a program whith a GdkWindow, and now i want to run gtk_main_quit()
if that window gets the delete-event.

How do i do that?
All examples i have read wants the first argument for gtk_signal_connect
to
be a GTK_OBJECT and i dont think a
GdkWindow is a GTK_OBJECT :(

Maybe its just me who is braindead, as usual...  but i cant see how to do
this.

I didn't get the gtkdrawable thing to work, but using a GdkWindow was very
easy.. and all i wanted was a window
to draw in, so a GdkWindow workes just fine for me :)

Maybe i will just have to learn how to use GtkDrawable..  but i would
rather use the GdkWindow..


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list







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