gnope php gtk gui gnope.org  

how to listen to a key pressed event?

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
Osiris



Joined: 17 Dec 2005
Posts: 65

PostPosted: Sun Feb 26, 2006 2:09 pm    Post subject: how to listen to a key pressed event? Reply with quote

Hello,

in a GtkNotebook-Tab (my search-tab) i want to listen to the key pressed event.
When the key "Return" is pressed i want to emmit the signal for the search button.

Can somebody show me an example of doing this?

Thanks a lot.

Christian
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Sun Feb 26, 2006 2:35 pm    Post subject: Reply with quote

What do you mean with "notebook tab"? I thought notebook tabs don't get the focus.
Back to top
Osiris



Joined: 17 Dec 2005
Posts: 65

PostPosted: Sun Feb 26, 2006 2:49 pm    Post subject: Reply with quote

When I've selected my search tab (notebook page)
here is the page

I would be able to listen, if the "Return"-key is pressed.
If this key is pressed i want to emmit the signal for start searching instead of the search button emmits this signal. (I know, very bad english ....)
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Sun Feb 26, 2006 2:53 pm    Post subject: Reply with quote

You need to connect the key press signal on each text entry widget, not the whole notebook. The notebook or the tab don't get the events.
Back to top
Osiris



Joined: 17 Dec 2005
Posts: 65

PostPosted: Sun Feb 26, 2006 3:20 pm    Post subject: Reply with quote

ok, at the end, this was more than easy after reading some Threads in the mailing-list.
Pressing the enter key emits the activate-signal..
more about this here


Last edited by Osiris on Sun Feb 26, 2006 3:54 pm; edited 1 time in total
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Sun Feb 26, 2006 3:25 pm    Post subject: Reply with quote

If you used MARC or so, could you give the urls so that people having the same problems will find it faster?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.