wxPython frame

Discussion in 'Python' started by Austin, Nov 2, 2004.

  1. Austin

    Austin Guest

    In tkinter, the dialogs has the function grab_set(). That means disable
    other windows while it's open.
    Is there any function like that in wxPython. I want to use it on my frame.
    For example, a.py is main frame. There is a button "config" to open
    b.py(config frame).
    If the function exists in wxPython, i could put that in b.py when b.py is
    open and we couldn't
    click a.py. Or any other ways to avoid click a.py when b.py is open.

    Thanks a lot.
    Austin, Nov 2, 2004
    #1
    1. Advertising

  2. Austin

    Peter Hansen Guest

    Austin wrote:
    > In tkinter, the dialogs has the function grab_set(). That means disable
    > other windows while it's open.
    > Is there any function like that in wxPython. I want to use it on my frame.
    > For example, a.py is main frame. There is a button "config" to open
    > b.py(config frame).
    > If the function exists in wxPython, i could put that in b.py when b.py is
    > open and we couldn't
    > click a.py. Or any other ways to avoid click a.py when b.py is open.


    The wxPython mailing list is probably a better way to get
    good answers to wxPython questions.

    -Peter
    Peter Hansen, Nov 2, 2004
    #2
    1. Advertising

  3. Austin

    Dan Perl Guest

    "Austin" <> wrote in message
    news:41872581$...
    > In tkinter, the dialogs has the function grab_set(). That means disable
    > other windows while it's open.
    > Is there any function like that in wxPython. I want to use it on my frame.
    > For example, a.py is main frame. There is a button "config" to open
    > b.py(config frame).
    > If the function exists in wxPython, i could put that in b.py when b.py is
    > open and we couldn't
    > click a.py. Or any other ways to avoid click a.py when b.py is open.
    >
    > Thanks a lot.


    Your question refers to frames, but I think you may mean dialogs (subclasses
    of wx.Dialog). So wx.Dialog.ShowModal( ) may be what you're looking for.
    See
    http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxdialog.html#wxdialogshowmodal.

    Here is an example with a file dialog from a project I am working on:
    dlg = wx.FileDialog(
    self,
    message="Save file as ...",
    defaultDir=os.path.join(os.environ['zigzag_install_dir'],
    'config'),
    wildcard="Python source (*.py)|*.py",
    style=wx.SAVE
    )
    if dlg.ShowModal() == wx.ID_OK:
    path = dlg.GetPath()
    # Open the file and write into it
    saveFile = file(path, "w")
    # [...] removed code that writes into the file
    saveFile.close()
    dlg.Destroy()

    Peter is right though, you may be better off asking questions on wxPython in
    the wxPython mailing list (http://www.wxpython.org/maillist.php).

    Dan
    Dan Perl, Nov 2, 2004
    #3
    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. Anand
    Replies:
    1
    Views:
    354
    Cliff Wells
    Jul 23, 2003
  2. ulysses
    Replies:
    4
    Views:
    764
    Werner Schiendl
    Oct 22, 2003
  3. Logan
    Replies:
    5
    Views:
    763
    David Bolen
    Dec 11, 2003
  4. Ruben Charles
    Replies:
    6
    Views:
    500
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Oct 25, 2005
  5. Robin Dunn
    Replies:
    0
    Views:
    517
    Robin Dunn
    Mar 28, 2006
Loading...

Share This Page