Re: GdkEventKey

From: Date: Fri, 05 Jan 2007 02:16:15 +0000
Subject: Re: GdkEventKey
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7541@lists.php.net to get a copy of this message
Sven Siwek wrote: > > Hi! > > I want to use this > > http://gtk.php.net/manual/en/gtk.gtkwindow.method.propagate_key_event.php > > But how do I create a GdkEventKey ? > > $my = new GdkEventKey(); does not work; it results in a "Class > 'GdkEventKey' not found " error. > > May someone can give me a hint how to use the propagate_key_event . > > Thanks a lot > > Sven > Hi Sven, The way to create the GdkEventKey you mentioned above is: $event = new GdkEvent(Gdk::KEY_PRESS); However, while creating the event is not an issue, the problem comes in setting the values of its properties. If you use GTK+ direct using C, I think you can set the values of keyval, state, etc. For one reason or the other, the developer team of php-gtk decides to make all these properties read-only. So you cannot set the value using $event->keyval = 65293 or $event->state=2. I have tried in the past many different ways to simulate keypress. In many cases when I stepped back and relooked at the application, I find that most of the time it is not really necessary to create a GdkEvent. If you can elaborate a bit on what you're trying to achieve, I may be able to come out with some sample code. Regards, /kksou -- View this message in context: http://www.nabble.com/GdkEventKey-tf2915139.html#a8171894 Sent from the Php - GTK - General mailing list archive at Nabble.com.

« previous php.gtk.general (#7541) next »