Help building GUI with Tix

Discussion in 'Python' started by infidel, Jul 3, 2007.

  1. infidel

    infidel Guest

    I am trying to build a GUI using the Tix module. What I want is a
    paned window with a tree in the left pane and a notebook in the right
    pane. I keep getting an error that I don't understand when adding
    these widgets to the panes:

    PythonWin 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit
    (Intel)] on win32.
    Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin'
    for further copyright information.
    >>> import Tix
    >>> app = Tix.Tk("Demo")
    >>> panes = Tix.PanedWindow(app)
    >>> panes.pack(fill=Tix.BOTH, expand=True)
    >>> tree = Tix.Tree(panes)
    >>> panes.add(tree)

    Traceback (most recent call last):
    File "<interactive input>", line 1, in <module>
    File "C:\Program Files\Python25\lib\lib-tk\Tix.py", line 1220, in
    add
    self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
    TclError: bad window path name ".16442432..16442432"
    >>>


    What am I missing?

    TIA
     
    infidel, Jul 3, 2007
    #1
    1. Advertising

  2. infidel

    infidel Guest

    Re: Help building GUI with Tix - solution

    I figured it out after finding an example somewhere:

    >>> import Tix
    >>> app = Tix.Tk("Demo")
    >>> panes = Tix.PanedWindow(app)
    >>> left = panes.add('left')
    >>> right = panes.add('right')
    >>> tree = Tix.Tree(left)
    >>> notebook = Tix.NoteBook(right)
    >>> tree.pack()
    >>> notebook.pack()
    >>> panes.pack()
    >>> app.mainloop()
     
    infidel, Jul 3, 2007
    #2
    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. Helmut Jarausch
    Replies:
    0
    Views:
    454
    Helmut Jarausch
    Jul 17, 2003
  2. Josh

    Tix + Python + Windows?

    Josh, Aug 13, 2003, in forum: Python
    Replies:
    2
    Views:
    725
    Kevin Mote
    Sep 5, 2003
  3. Hank

    installing Tix

    Hank, Aug 19, 2003, in forum: Python
    Replies:
    1
    Views:
    394
    Christos TZOTZIOY Georgiou
    Aug 23, 2003
  4. Midex
    Replies:
    24
    Views:
    953
  5. Replies:
    2
    Views:
    5,312
    ambri
    Jun 6, 2011
Loading...

Share This Page