Tkinter, tkFileDialog, and checkbuttons

Discussion in 'Python' started by Frank Chen, Oct 5, 2003.

  1. Frank Chen

    Frank Chen Guest

    Hi:

    The attahced file is an example that confuses me.
    When executing test.py and then click [File] menu,
    you can see the menu constitutes 'New Window',
    'Open File', and an activated checkbutton, 'Show toolbar'.

    Now please select 'New Window', which will cause App class
    to generate a child root derived from Tk(). The status of the
    checkbuttons becomes unselected.

    And if you select 'Open File' of child root window, the main root
    Tk() will be popped up to the layer above child root.

    It will be grateful if someone can tell me how to cope with this.

    --Frank
    Frank Chen, Oct 5, 2003
    #1
    1. Advertising

  2. Frank Chen

    Lars Behrens Guest

    Frank Chen wrote:

    > The attahced file is an example that confuses me.


    will you please write in plain text, not html. And don't use
    attachements, post your text in line. Thank you.

    Cheerz Lars
    Lars Behrens, Oct 5, 2003
    #2
    1. Advertising

  3. > "Frank Chen" <>

    > Now please select 'New Window', which will cause App class
    > to generate a child root derived from Tk(). The status of the
    > checkbuttons becomes unselected.


    All checkbuttons use the same variable, try:
    self.checkmark=StringVar()
    self.menu.menu.add_checkbutton(label='Show tool bar', underline=0,

    variable=self.checkmark,

    > And if you select 'Open File' of child root window, the main root
    > Tk() will be popped up to the layer above child root.


    Try:
    tkFileDialog.askopenfilename(
    parent=self.master,

    Kindly
    MichaelP

    BTW there are a lot of questionable constructs in your program. You are
    using 'app' as local variable in new_window which might lead to garbage
    collecting the App-instance at an inapropriate situation, the packs() will
    not work well when resizing the window, why do you separate initialization
    from 'create'?, .......
    Michael Peuser, Oct 5, 2003
    #3
  4. In article <blovr0$lpn$06$-online.com>,
    Michael Peuser <> wrote:
    .
    .
    .
    >BTW there are a lot of questionable constructs in your program. You are
    >using 'app' as local variable in new_window which might lead to garbage
    >collecting the App-instance at an inapropriate situation, the packs() will
    >not work well when resizing the window, why do you separate initialization
    >from 'create'?, .......

    .
    .
    .
    "... the packs() will not work ...": do you know of
    a general fault in pack() that impairs their useful-
    ness in all applications, or are you saying that their
    use in the example originally posted was suboptimal?
    --

    Cameron Laird <>
    Business: http://www.Phaseit.net
    Cameron Laird, Oct 8, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Irmen de Jong
    Replies:
    2
    Views:
    1,897
    Irmen de Jong
    Apr 30, 2004
  2. Gigs_
    Replies:
    2
    Views:
    343
    Eric Brunel
    Feb 21, 2007
  3. Leonhard Vogt

    Tkinter Entry blocked by tkFileDialog

    Leonhard Vogt, Oct 2, 2008, in forum: Python
    Replies:
    0
    Views:
    359
    Leonhard Vogt
    Oct 2, 2008
  4. Joe Van Dyk

    Tkmenubar and checkbuttons

    Joe Van Dyk, May 5, 2005, in forum: Ruby
    Replies:
    4
    Views:
    98
    Joe Van Dyk
    May 5, 2005
  5. David Douthitt
    Replies:
    8
    Views:
    266
    Hidetoshi NAGAI
    Jul 15, 2005
Loading...

Share This Page