#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Bimingham,AL
    Posts
    68
    Rep Power
    11

    Responding only to user events


    Hi,
    I am using wxpython . I have a wxTextCtrl in the Gui .
    I am using EVT_TEXT(id, func) to handle events on textctrl.
    But this event will always be sent when the text controls contents changes - whether this is due to user input or comes from the program itself (for example, if SetValue() is called) .
    I want this function to called when user inputs something not when SetValue is called.How do I do that.
    thanks
    surya
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    34
    If you want to respond to user actions, respond to mouse moves/clicks and keyboard presses.

    If you want to respond to text changed, respond to text changed.

    Responding to text changed but wanting only certain changes isn't a good plan, or particularly easy.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Location
    Bimingham,AL
    Posts
    68
    Rep Power
    11
    Thank you very very much for the response
    Actually my problem is ,

    I have a textCrtl in GUi which is initialized with a value of cetrain string variable. It also has a Apply button.
    But i want it to be disable when GUI loads up since user has not changed anything on Textctrl . I want Apply button to be enabled when users changes value in TextCtrl .But apply button is enabled because textCtrl is initalized with value of a variable hence causing txt_event.
  6. #4
  7. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Why not just disable e.g. apply_button.Enable(False), the Apply button after the text box is initialized or only bind the txt_event after the initialization.

    grim

IMN logo majestic logo threadwatch logo seochat tools logo