Python multiple" commands" in widgets

0 graham burgess · May 2, 2015
Can anyone tell me how to build two commands into a single button (or other) widget
thanks

Post a Reply

Replies

Oldest  Newest  Rating
0 Catalin Festila · May 3, 2015
... if you use event button then just try to use the non-event button action .
this issue can be a crazzy stuff :'(
+1 alex constantin · May 3, 2015
Create one callback function that calls the two or more functions

def function1():
   # Code
def function2():
   # Code

def combo():
   function1()
   function2()


myButton = Button(root, text='Click', command=combo)

 I would not recommend this method for more complex GUIs though
0 graham burgess · May 3, 2015
Hi Catalin & Alex,

Thanks for your advice and suggestions
0 graham burgess · May 3, 2015
hey Alex,

your suggestion worked perfectly, and I will have a look at the book you recommended, thanks again
  • 1

Python

107,097 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator