[Python-checkins] CVS: python/dist/src/Lib/lib-tk Tix.py,NONE,1.1

Martin v. L?wis loewis@users.sourceforge.net
Tue, 20 Mar 2001 23:42:09 -0800


Update of /cvsroot/python/python/dist/src/Lib/lib-tk
In directory usw-pr-cvs1:/tmp/cvs-serv20033/Lib/lib-tk

Added Files:
	Tix.py 
Log Message:
Patch #410231: Add the Python Tix library.


--- NEW FILE: Tix.py ---
#
# $Id: Tix.py,v 1.1 2001/03/21 07:42:07 loewis Exp $
#
# Tix.py -- Tix widget wrappers, part of PyTix.
#
#	- Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
#	  based on an idea (and a little code !!) of Jean-Marc Lugrin
#						     (lugrin@ms.com)
#
# NOTE: In order to minimize changes to Tkinter.py, some of the code here
#	(TixWidget.__init__) has been taken from Tkinter (Widget.__init__)
#	and will break if there are major changes in Tkinter.
#
# The Tix widgets are represented by a class hierarchy in python with proper
# inheritance of base classes.
#
# As a result after creating a 'w = StdButtonBox', I can write
#		w.ok['text'] = 'Who Cares'
#    or		w.ok['bg'] = w['bg']
[...1227 lines suppressed...]
########################
### Utility Routines ###
########################

# Returns the qualified path name for the widget. Normally used to set
# default options for subwidgets. See tixwidgets.py
def OptionName(widget):
    return widget.tk.call('tixOptionName', widget._w)

# Called with a dictionary argument of the form
# {'*.c':'C source files', '*.txt':'Text Files', '*':'All files'}
# returns a string which can be used to configure the fsbox file types
# in an ExFileSelectBox. i.e.,
# '{{*} {* - All files}} {{*.c} {*.c - C source files}} {{*.txt} {*.txt - Text Files}}'
def FileTypeList(dict):
    s = ''
    for type in dict.keys():
	s = s + '{{' + type + '} {' + type + ' - ' + dict[type] + '}} '
    return s