Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 97dd72350201452f73858da147c3160510ada3ae
Ticket: 3565164fffffffffffffffffffffffffffffffff
bind<ButtonRelease-1> doesnt have same behavior on windows
User & Date: sunblackshine on 2012-09-06 02:41:07
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I write a xml layout feature for my work, recently. And I want bind a radiobutton or checkbutton click event on a method, but do not affect "command" configure option.
    so I use the Events and Bindings, I write it like this widget.bind("<ButtonRelease-1>", lambda event: self.enable_toggle(data))
    and 
        def enable_toggle(self, widget):
           print widget_value_map[widget].get() # this will get the widget's variable and get it value.
    
    on linux platform, the <ButtonRelease-1> event will be called after variable change, so I get the correct value in enable_toggle
    but on windows platform, the event will be called before variable change, so I get the wrong value.
    
    version:(python version  2.7.3)
    Linux:
    >>> Tkinter.TkVersion
    8.5
    >>> Tkinter.TclVersion
    8.5
    Windows:
    >>> Tkinter.TkVersion
    8.5
    >>> Tkinter.TclVersion
    8.5
    
    
    I wrte a simple code(attachment) to show this bug. I want the code have same result on linux and windows, but it doesnt.
    
    BTW: Is there a way to bind multiple method to an button click event? If a better one please tell me. Thank you. mailto: [email protected]
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "sunblackshine"
  10. subsystem changed to: "None"
  11. title changed to:
    bind<ButtonRelease-1> doesnt have same behavior on windows
    
  12. type changed to: "Bug"