python gtk: input box and "enter"

E

edgue

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
 
N

Nobody

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top