Mouse events on a frame : Mouse Action : Event PYTHON examples


PYTHON examples » Event » Mouse Action »

 

Mouse events on a frame


Mouse events on a frame: Mouse left

from Tkinter import *

class MouseLocationFrame ):
   def __init__self ):
      Frame.__init__self )
      self.packexpand = YES, fill = BOTH )
      self.master.title"Demonstrating Mouse Events" )
      self.master.geometry(  "275x100" )
      
      self.mousePosition = StringVar() # displays mouse position
      self.mousePosition.set"Mouse outside window" )
      self.positionLabel = Labelself,
         textvariable = self.mousePosition )
      self.positionLabel.packside = BOTTOM )

      self.bind"<Leave>", self.exitedWindow )

   def exitedWindowself, event ):
      self.mousePosition.set"Mouse outside window" )


def main():
   MouseLocation().mainloop()

if __name__ == "__main__":
   main()

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Event
» Mouse Action