Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter- New Window

Reply
Thread Tools

Tkinter- New Window

 
 
Tuvas
Guest
Posts: n/a
 
      11-04-2005
Is there a way to make a new window pop up using Tkinter? I have some
functions that require more data in my interface than I have space for,
and would like to be able to pop up a new window to request this
information. Thanks!

 
Reply With Quote
 
 
 
 
Tuvas
Guest
Posts: n/a
 
      11-04-2005
Okay, never mind about my first question, I got that answer by using
Toplevel. However, there' s still a question to be answered.

I popped up this new window with the intent to have something like
this:

"what is your question"
____________________
<Button to close>

Ei, there's a question popped up, a label that gathers information, and
a button that will close it. However, I can't get the button to close
it, it keeps saying that the variable isn't defined. I haven't even
tried to get it to read the value of the label, but I think that it
will be a similar type problem. Any nice ways around this problem? I do
want these values only to be called when the function is called. Thanks!

 
Reply With Quote
 
 
 
 
Jim Segrave
Guest
Posts: n/a
 
      11-04-2005
In article <(E-Mail Removed). com>,
Tuvas <(E-Mail Removed)> wrote:
>Is there a way to make a new window pop up using Tkinter? I have some
>functions that require more data in my interface than I have space for,
>and would like to be able to pop up a new window to request this
>information. Thanks!


Dialogue boxes pop up new windows for gathering information. If you
want a more permanent second window, then the Toplevel() widget is
like a frame, but is a separte window with window manager
decorations, can be sparately iconfied etc.

from Tkinter import *
root = Tk()
root.title('Root')
rootlabel = Label(root, text = 'This is the root window', relief = RIDGE)
rootlabel.pack(side = TOP, fill = BOTH, expand = YES)
other = Toplevel()
other.title('Second Window')
otherlabel = Label(other, text = 'This is the other window', relief = RIDGE)
otherlabel.pack(side = TOP, fill = BOTH, expand = YES)
root.mainloop()



--
Jim Segrave ((E-Mail Removed))

 
Reply With Quote
 
James Stroud
Guest
Posts: n/a
 
      11-04-2005
On Friday 04 November 2005 10:01, Tuvas wrote:
> Okay, never mind about my first question, I got that answer by using
> Toplevel. However, there' s still a question to be answered.
>
> I popped up this new window with the intent to have something like
> this:
>
> "what is your question"
> ____________________
> <Button to close>
>
> Ei, there's a question popped up, a label that gathers information, and
> a button that will close it. However, I can't get the button to close
> it, it keeps saying that the variable isn't defined. I haven't even
> tried to get it to read the value of the label, but I think that it
> will be a similar type problem. Any nice ways around this problem? I do
> want these values only to be called when the function is called. Thanks!


Looks like you are reinventing the wheel. Check out the tkMessageBox module.

James


--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to post the data to a new window and control the new window's property? Matt HTML 5 08-25-2004 08:14 AM
How to post the data to a new window and control the new window's property? Matt ASP .Net 2 08-23-2004 05:29 PM
How to post the data to a new window and control the new window's property? Matt Java 1 08-22-2004 09:09 PM
How to use an asp:button to create a new browser window and output contents to new window =?Utf-8?B?Tm92aWNl?= ASP .Net 2 06-09-2004 10:54 PM
Need to open a new browser window, not a new window Gordon ASP General 3 04-16-2004 10:46 PM



Advertisments