Re: Event key problems
| From: | Madeleine D. | Date: | Thu, 09 Dec 2004 22:37:29 +0000 |
| Subject: | Re: Event key problems | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5331@lists.php.net to get a copy of this message | ||
Steph -
I've double-checked our side to make sure there's no duplicate calls
anywhere, but I agree - it sounds like some kind of twice-called signal.
If you don't handle the tab key, it moves from widget to widget
automatically - part of core behavior. Maybe that's the key somehow - by
trying to capture the signal, we end up doubling it.
The problem is we need to capture it for editing purposes, and to control
the tab order...
Madeleine D.
TTI
At 12:17 AM 12/10/04 +0200, Steph wrote:
>I don't have src handy to check this out, but it sounds like you're
>effectively doing the same thing twice? What happens if you don't handle
>it?
>
>----- Original Message -----
>From: "Madeleine D." <mmdrake@bctonline.com>
>To: <php-gtk-general@lists.php.net>
>Sent: Thursday, December 09, 2004 10:56 PM
>Subject: [PHP-GTK] Event key problems
>
>
>> We have some problems dealing with the tab key in events.
>>
>> Env: Win98/WinNT, PHP-Gtk 1.0
>>
>> We've been using the key_press_event to successfully trap a number of keys
>> - like Functions, return, etc. Now we want to capture the GDK_KEY_tab.
>> But, it is not working right. Using a simple $nextObj->grab_focus(),
>> instead of moving to the next widget in our frame, it ends up exactly one
>> widget past. Doesn't seem to matter if the next object is entry or button
>> or whatever...
>>
>> Sample code below:
>>
>> calling widget:
>> $address_2->connect_object('key_press_event', 'PMfieldEvent',
>> 'address_2','mbrs','mbrs_addr',$zip_code,"");
>>
>> event function:
>> function PMfieldEvent($event,$widget,$source,$destination,$next,$display)
>{
>>
>> // Working code
>> if ($event->keyval == GDK_KEY_F4) {
>> PMdbSearch($source,$destination,$next,$display);
>>
>> // New code added 12/3/04
>> } elseif ($event->keyval == GDK_KEY_tab) {
>> $next->grab_focus();
>> }
>>
>> } //End field event process
>>
>>
>> I've trapped the $event->keyval to verify that it is getting the tab call.
>> I've also tried switching to the numeric 65289. No luck.
>>
>> Any suggestions?
>>
>> thanks,
>> Madeleine D.
>>
>> --
>> PHP-GTK General Mailing List (http://gtk.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>