[Tutor] Button, Button, How do I put the Button
Tim Johnson
tim@johnsons-web.com
Mon, 19 Feb 2001 18:50:26 -0900
Hello All:
Below is some code that is meant to hold two buttons and a text window.
<duh> I don't know quite how to place the buttons</duh>
Two Questions:
1)How do I place the buttons side by side, instead of one above the other?
2)Where is documentation relevant to my questions.
BTW: Thanks to all for all the input on my question on sound()
Code to follow
################################################################
from Tkinter import *
from ScrolledText import *
import sys
def die(event):
sys.exit(0)
def test(event):
pass
root = Tk()
text_frame = Frame(root)
text_frame.pack(expand=1,fill=BOTH)
# build the "quit" button
q_button = Button(text_frame,width=25)
q_button["text"] = "Quit"
q_button.bind("<Button>",die)
q_button.pack()
#build the "test" button
t_button = Button(text_frame,width=25)
t_button["text"] = "Test"
t_button.bind("<Button>",test)
t_button.pack()
#would like to put the buttons side by side, but how?
st = ScrolledText(text_frame ,background="white")
st.pack()
root.mainloop()
################################################################
TIA :)
--
Tim Johnson
-----------
"Of all manifestations of power,
restraint impresses the most."
-Thucydides