Using TCL files in Python ?

Jeff Epler jepler at unpythonic.net
Wed May 11 08:22:09 EDT 2005


While I've never used it, there *is* a Tix module in Python which
appears to wrap the widgets provided by Tix.  In Fedora Core 2, Python
doesn't seem to be configured to use Tix OOTB but a one-liner (that
should be harmless elsewhere) does make it work.

These classes are defined in the Tix module:
['Shell', 'Meter', 'TixSubWidget', 'ExFileSelectDialog',
'NoteBookFrame', 'DirSelectDialog', 'Control', 'LabelEntry',
'ButtonBox', 'ScrolledTList', 'Select', 'HList', 'Balloon', 'PopupMenu',
'DirSelectBox', 'ComboBox', 'ScrolledWindow', 'Grid', 'CheckList',
'DialogShell', 'Tree', 'DirList', 'ResizeHandle', 'NoteBook',
'ListNoteBook', 'ScrolledGrid', 'FileEntry', 'ScrolledHList', 'DirTree',
'OptionMenu', 'ScrolledText', 'LabelFrame', 'FileSelectBox',
'ScrolledListBox', 'InputOnly', 'PanedWindow', 'StdButtonBox',
'FileSelectDialog', 'CObjView', 'ExFileSelectBox', 'TList']

Here's what I did to get a simple Tix widget to work:
>>> import Tkinter, Tix
>>> t = Tkinter.Tk()
>>> t.tk.call("package", "require", "Tix")
'8.1.8.4'
>>> u = Tix.ComboBox(t)
>>> for i in range(30): u.insert("end", "Item %d" % i)
... 
>>> u.pack()

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050511/fce00407/attachment.sig>


More information about the Python-list mailing list