Image button mouse action : Mouse Action : Event PYTHON examples


PYTHON examples » Event » Mouse Action »

 

Image button mouse action




from Tkinter import *
from tkMessageBox import *

class PlainAndFancyFrame ):
   def __init__self ):
      Frame.__init__self )
      self.packexpand = YES, fill = BOTH )
      self.master.title"Buttons" )

      self.myImage = PhotoImagefile = "logotiny.gif" )
      self.fancyButton = Buttonself, image = self.myImage,
                                       command = self.pressedFancy )
      self.fancyButton.bind"<Enter>", self.rolloverEnter )
      self.fancyButton.bind"<Leave>", self.rolloverLeave )
      self.fancyButton.packside = LEFT, padx = 5, pady = )

   def pressedFancyself ):
      showinfo"Message""You pressed: Fancy Button" )

   def rolloverEnterself, event ):
      event.widget.configrelief = GROOVE )

   def rolloverLeaveself, event ):
      event.widget.configrelief = RAISED )

def main():
   PlainAndFancy().mainloop()

if __name__ == "__main__":
   main()


           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo Event
» Mouse Action