Re: Event key problems

From: Date: Fri, 10 Dec 2004 18:14:30 +0000
Subject: Re: Event key problems
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5333@lists.php.net to get a copy of this message
Steph - Thanks for the tip. I think you're right; I will have to investigate blocking the signal. Madeleine D. At 02:52 AM 12/10/04 +0200, you wrote: >It seems very likely that it's already handled within the GTK source.. >basically the GTK widgets are set up exactly like we set them up from the >PHP bindings, only in C. So it'll be hard-coded in. > >Try blocking the key_press_event signal with return true or false or >whatever it is it doesn't expect, and fire up your function from >key_release_event, see if you can confuse it :) > >----- Original Message ----- >From: "Madeleine D." <mmdrake@bctonline.com> >To: "Steph" <steph@zend.com>; <php-gtk-general@lists.php.net> >Sent: Friday, December 10, 2004 12:37 AM >Subject: Re: [PHP-GTK] Event key problems > > >> 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 >> >> >> > >> > > >

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