LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2005, 06:29 PM   #1
firefly2442
Member
 
Registered: Apr 2003
Location: USA
Distribution: Ubuntu
Posts: 95

Rep: Reputation: 15
Creating additional windows with python+tkinter


Hello. I'm going through "Learning Python" and "Programming Python" both by O'Reilly. I'm trying to create a fairly simple program. I have a main file "login.py" which asks for a username and then I want it to open up another window where the majority of the program will be. What is the best way to do this? Would it be easiest to create separate .py files/programs for each of the windows I'm going to need? Thanks in advance!
 
Old 07-13-2005, 01:30 AM   #2
evilmrhenry
Member
 
Registered: Oct 2003
Distribution: Knoppix
Posts: 103

Rep: Reputation: 15
I recommend using separate .py files for each window, to allow for future expansion.

Basically:
Code:
import rest_of_program

window_root = Tk()

def return_user_and_pass():
    window_user_pass = Toplevel()
    #blahblahblah
    window_user_pass.master.wait_window(window_user_pass)
    return username, password

def user_pressed_enter():
    window_user_pass.destroy()

user, pass = return_user_and_pass()

if allow_entry(user, pass) == 1:
    run_rest_of_program()
I'm not quite sure on the syntax of everything, but it should work.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tkinter integration to python 2.3.4 gaddargarson Programming 1 03-09-2005 05:58 AM
Python / Tkinter : 2 quick questions infidel Programming 0 12-31-2004 05:19 PM
Python and Tkinter 1337 Twinkie Fedora 2 08-03-2004 12:35 PM
Python: Tkinter. Chu Programming 0 11-10-2003 02:56 AM
Python and Tkinter Error Gerardoj Programming 1 11-08-2003 10:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration