Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

python gtk: input box and "enter"

4 views
Skip to first unread message

edgue

unread,
Dec 23, 2009, 2:41:31 AM12/23/09
to
Hello there,

I am somewhat fluent in python ... good enough for the daily business
scripting stuff. I have a little script that I use to start the afs
service
on my machine and to collect tokens for multiple afs cells.

I want to enter the password using a GUI window (stdin
in a terminal window is too easy to miss) ... and I found
an "input_box" example for python gtk here:

http://learnfobia.com/category-Computers-107/tutorial-GUI-Applications-in-Python-1935.html

Problem is: this example lets me enter some text ... but when I press
'Enter' ... nothing happens. I have to move the focues to the OK
button;
either by clicking with the mouse or by pressing TAB.

The message box example from that page works as expected - I press
enter and such a window goes away.

I played around a bit .... couldnt find the setting that would help.
Can you help? How do I use gtk to enter a (hidden) text press
ENTER ... done?

regards,
eg

Nobody

unread,
Dec 23, 2009, 6:33:02 AM12/23/09
to
On Tue, 22 Dec 2009 23:41:31 -0800, edgue wrote:

> How do I use gtk to enter a (hidden) text press ENTER ... done?

Connect the gtk.Entry's "activate" signal to the click() method:

self.entry.connect("activate", self.click)

edgue

unread,
Dec 23, 2009, 6:39:44 AM12/23/09
to
On Dec 23, 12:33 pm, Nobody <nob...@nowhere.com> wrote:

> self.entry.connect("activate", self.click)

Does the job.

Thank you very much!

0 new messages