Using TCL files in Python ?

Peter Moscatt pgmoscatt at optushome.com.au
Thu May 12 03:46:24 EDT 2005


Many thanks to all who have helped me out on this one - much appreciated.

Pete



On Wed, 11 May 2005 07:22:09 -0500, Jeff Epler wrote:

> 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




More information about the Python-list mailing list