GUI tk question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jumperbl
    New Member
    • Mar 2008
    • 17

    GUI tk question

    what is the purpose of of this line "makemodal = (len(sys.argv) > 1)" in this script:

    #!/usr/bin/env python
    import sys
    from Tkinter import *
    makemodal = (len(sys.argv) > 1)

    class Yoli(Frame):

    def __init__(self, master):
    Frame.__init__( self, master)
    self.grid()
    self.createwidg ets()

    def loveyoli(self):
    win = Toplevel()
    Label(win, text='I love you Yoli').pack()
    if makemodal:
    win.focus_set()
    win.grab_set()
    win.wait_window ()
    #print 'dialog exit'

    def callloveyoli(se lf):
    i = 0
    j = 10
    while i <j:
    self.loveyoli()
    i = i+1


    def createwidgets(s elf):
    self.numb_lbl = Label(text = "Enter a number")
    self.numb_lbl.g rid(row = 0, column = 0,
    columnspan = 2, sticky = W)
    Button(root, text='A screet',
    command=self.ca llloveyoli).gri d(row=4, column = 0,
    sticky = W)

    root = Tk()
    root.title('A message for Yoli')
    app = Yoli(root)
    root.mainloop()
  • Stang02GT
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    You have 4 posts that were made in the correct threads (at least i think so, i didn't look into it that much) but none the less this is an Introduction forum where people introduce themselves, it is not for technical questions.


    Please review the POSTING GUIDELINES and make sure you are positing your questions in the correct forums.

    If you cannot find a forum that you feel is appropriate, please ask or post in the MISC forum.


    Thank You.

    Comment

    Working...