[Tutor] Button, Button, How do I put the Button

Glen Wheeler wheelege@tsn.cc
Tue, 20 Feb 2001 16:19:05 +1100


(note: I'm still what I classify as newbie to tkinter, so watch out for what
I say....could be wrong!)

  I think what you are looking for here is documentation of the various
geometry managers that Tkinter uses (from Tcl/Tk).
  These are Place, Grid and Pack.  The documentation I refer from is John
Graysons book 'Python and Tkinter Programmin' which I have found extremewly
useful.  However there is more documentation located on the web - most
probably linked from somewhere in www.python.org.

  HTH,
  Glen.

----- Original Message -----
From: Tim Johnson <tim@johnsons-web.com>
To: <tutor@python.org>
Sent: Tuesday, February 20, 2001 2:50 PM
Subject: [Tutor] Button, Button, How do I put the Button


> 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
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor