What are the errors in a simpliest Tix application?

Discussion in 'Python' started by =?windows-1251?b?xeLj5e3o6SDK7vHl7eru?=, Dec 9, 2003.

  1. Hi!

    I make my first steps in Tkinter/Tix programming. The next program is work
    well (really, _almost_ well):

    import Tkinter

    root = Tkinter.Tk()
    widget = Tkinter.Button(root)

    Really, this is not an application, it is only the minimal non-problematic
    piece of application code.

    As the Python Library manual says, the only thing I need to use Tix is to
    replace Tkinter in the last program to Tk:

    import Tix

    root = Tix.Tk()
    widget = Tix.Button(root)

    However, I have got the next exception tracelist:

    Traceback (most recent call last):
    File "tix.py", line 4, in ?
    widget = Tix.Button(root)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1906, in __init__
    Widget.__init__(self, master, 'button', cnf, kw)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1835, in __init__
    self.tk.call(
    _tkinter.TclError: expected integer but got "-"

    I'm sure that the Tix platform -- I saw demos succesfully. It seems like an
    error inside the Tix package. Maybe, something wrong in my code pattern, but
    I may not understand, where is my mistake. Who can help me?

    When I use an integer parameter in the program:

    widget = Tix.Button(root, 10)

    the exception tracelist is different:

    Traceback (most recent call last):
    File "tix.py", line 4, in ?
    widget = Tix.Button(root, 10)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1906, in __init__
    Widget.__init__(self, master, 'button', cnf, kw)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1829, in __init__
    BaseWidget._setup(self, master, cnf)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1809, in _setup
    if cnf.has_key('name'):
    AttributeError: 'int' object has no attribute 'has_key'

    Originally, I need the ComboBox widget from Tix, and for it I got the next
    tracelist:

    Traceback (most recent call last):
    File "tix.py", line 4, in ?
    widget = Tix.ComboBox(root, 10)
    File "/usr/lib/python2.3/lib-tk/Tix.py", line 576, in __init__
    cnf, kw)
    File "/usr/lib/python2.3/lib-tk/Tix.py", line 284, in __init__
    cnf = _cnfmerge(cnf)
    File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 85, in _cnfmerge
    for c in _flatten(cnfs):
    TypeError: len() of unsized object
     
    =?windows-1251?b?xeLj5e3o6SDK7vHl7eru?=, Dec 9, 2003
    #1
    1. Advertising

  2. =?windows-1251?b?xeLj5e3o6SDK7vHl7eru?=

    klappnase Guest

    ??????? ??????? <> wrote in message news:<>...

    > As the Python Library manual says, the only thing I need to use Tix is to
    > replace Tkinter in the last program to Tk:
    >
    > import Tix
    >
    > root = Tix.Tk()
    > widget = Tix.Button(root)
    >
    > However, I have got the next exception tracelist:
    >
    > Traceback (most recent call last):
    > File "tix.py", line 4, in ?
    > widget = Tix.Button(root)
    > File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1906, in __init__
    > Widget.__init__(self, master, 'button', cnf, kw)
    > File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1835, in __init__
    > self.tk.call(
    > _tkinter.TclError: expected integer but got "-"
    >

    Does the manual say so? I never heard about this, I always use something like:

    import Tkinter
    import Tix

    root = Tix.Tk()
    button = Tkinter.Button(root)
    etc...

    This way I never had problems.

    Cheers

    Michael
     
    klappnase, Dec 10, 2003
    #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. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    993
    Mark Goldin
    Jan 17, 2004
  2. Helmut Jarausch
    Replies:
    0
    Views:
    449
    Helmut Jarausch
    Jul 17, 2003
  3. Josh

    Tix + Python + Windows?

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

    installing Tix

    Hank, Aug 19, 2003, in forum: Python
    Replies:
    1
    Views:
    391
    Christos TZOTZIOY Georgiou
    Aug 23, 2003
  5. Sanjay Minni
    Replies:
    0
    Views:
    353
    Sanjay Minni
    Sep 1, 2003
Loading...

Share This Page