python gtk: input box and "enter"

Discussion in 'Python' started by edgue, Dec 23, 2009.

  1. edgue

    edgue Guest

    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
     
    edgue, Dec 23, 2009
    #1
    1. Advertising

  2. edgue

    Nobody Guest

    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)
     
    Nobody, Dec 23, 2009
    #2
    1. Advertising

  3. edgue

    edgue Guest

    On Dec 23, 12:33 pm, Nobody <> wrote:

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


    Does the job.

    Thank you very much!
     
    edgue, Dec 23, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ashutosh
    Replies:
    3
    Views:
    9,033
    Andrew Thompson
    Jun 16, 2005
  2. cjl
    Replies:
    1
    Views:
    10,529
    Michael Winter
    Oct 31, 2005
  3. Replies:
    2
    Views:
    538
  4. cjl
    Replies:
    7
    Views:
    206
    Thomas 'PointedEars' Lahn
    Oct 30, 2005
  5. HopfZ
    Replies:
    0
    Views:
    611
    HopfZ
    Aug 28, 2006
Loading...

Share This Page