How can I formulate a gdkevent?
| From: | anthony | Date: | Sat, 09 Jul 2005 16:55:13 +0000 |
| Subject: | How can I formulate a gdkevent? | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5941@lists.php.net to get a copy of this message | ||
No answer yet, I'll try once more:
I want to be able to navigate a ctree using the keyboard. To do that comfortably I need to control focus. However there seem to be no methods to control focus - as opposed to selection - in gtkclist and gtkctree, the only one concerning focus at all is the focus_row property of gtkclist that only reads the row number.
So the only way I can see is to simulate key-press events that take me where I want to be. And there are indeed methods, namely event() and main_do_event(), that take a gdkevent as argument. "This method causes event to be triggered. This in turn causes the widget to emit an appropriate signal.", as I read in
http://gtk.php.net/manual/en/gtk.gtkwidget.method.event.php.
This is just what I want. Now, there is more stuff concerning events in
http://gtk.php.net/manual/en/gdk.gdkevent.php
and
http://gtk.php.net/manual/en/signals.events.php
but, sadly, nothing on how to actually formulate one. Everyone seems to think only about events that are already given as input from keyboard or mouse.
But should it not be possible to create them using a GdkEventType and property? E.g. for the case in hand GDK_KEY_PRESS and GDK_KEY_Up, GDK_KEY_Down etc., something like "GDK_KEY_PRESS->keyval=GDK_KEY_Down" (which is nonsense and produces a parse error). I tried all kinds of combinations, but of course without success.
So please: Does anyone know how to do this?
Anthony