Re: Can "enter-notify-event" be used on a GtkImage ?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kalle Vahlman wrote:
| 2008/4/3, gtk amnesia accessgate com sg <gtk amnesia accessgate com sg>:
| [GtkImage and event signals]
|>  If I instead enable the NOTIFY_MASK's on an EventBox, then the signal handler
|>  see's the signals.
| [...]
|>  It seems to me that somehow I ought to be able to trigger enter/leave events on
|>  the image itself. Or can not that be done ?
|
| It can not. Quote from the GtkImage description:
|
| ---
| GtkImage is a "no window" widget (has no GdkWindow of its own), so by
| default does not receive events.
| ----

hrmpf.. well, that explains my frustration in getting gtk image to work. Thanks's for the
pointer!

| This holds true to for any "no window" widget and any signal (at least
| from GtkWidget) with the suffix "-event". It is true that GtkWidget
| description probably should mention this (though I don't expect it to
| be a logical place to look at for people wondering about this
| particular problem),

Well... I see your point. But let me explain how I got there. Many widgets inherit signals
from their parent class. When I'm looking (for example) at GtkCheckButton for how to
handle the check button ticks, there is no mention of the "toggled" signal in the
GtkCheckButton page. But it IS mentioned in the parent class page (GtkToggleButton).

So it DOES make sense to refer to parent classes to find out the complete set of signals
that may be available to a widget... (I'm using "may" instead of "should" because of the
above! :)

| but it _is_ mentioned (briefly) in the official
| tutorial:
|
|   http://library.gnome.org/devel/gtk-tutorial/stable/x483.html
|
| It also describes the eventbox method as the way to capture them, as you did.

Agreed. And the EventBox page specifically mentions that it (the EvenBox) can be used
specifically for the purpose of capturing events that a widget, for whatever reason,
cannot otherwise capture :)

Thanks for the clarification on the GtkImage and enter/leave events !

Best rgds,

- -Greg

- --
+---------------------------------------------------------------------+

Please also check the log file at "/dev/null" for additional information.
		(from /var/log/Xorg.setup.log)

| Greg Hosler					ghosler redhat com    |
+---------------------------------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFH9LTk404fl/0CV/QRAqE1AKDEwNXdab5/6iGVBzvJqv1vUIEUhQCgww2t
93VK8PLAlJAABpiO8oYoPpg=
=0JIl
-----END PGP SIGNATURE-----


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