[Python-checkins] python/dist/src/Demo/tix tixwidgets.py,1.6,1.7
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
Wed, 13 Nov 2002 18:44:10 -0800
Update of /cvsroot/python/python/dist/src/Demo/tix
In directory usw-pr-cvs1:/tmp/cvs-serv11823
Modified Files:
tixwidgets.py
Log Message:
Sync tixwidgets from Mike Clarkson, a maintainer
Index: tixwidgets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Demo/tix/tixwidgets.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** tixwidgets.py 17 Mar 2002 18:19:13 -0000 1.6
--- tixwidgets.py 14 Nov 2002 02:44:08 -0000 1.7
***************
*** 7,12 ****
# For Tix, see http://tix.sourceforge.net
#
! # This is a demo program of all Tix widgets available from Python. If
! # you have installed Python & Tix properly, you can execute this as
#
# % python tixwidgets.py
--- 7,12 ----
# For Tix, see http://tix.sourceforge.net
#
! # This is a demo program of some of the Tix widgets available in Python.
! # If you have installed Python & Tix properly, you can execute this as
#
# % python tixwidgets.py
***************
*** 15,18 ****
--- 15,19 ----
import os, os.path, sys, Tix
from Tkconstants import *
+ import traceback, tkMessageBox
TCL_DONT_WAIT = 1<<1
***************
*** 66,73 ****
help['menu'] = hm
- if w.tk.eval ('info commands console') == "console":
- fm.add_command(label='Console', underline=1,
- command=lambda w=w: w.tk.eval('console show'))
-
fm.add_command(label='Exit', underline=1,
command = lambda self=self: self.quitcmd () )
--- 67,70 ----
***************
*** 77,80 ****
--- 74,78 ----
#apply(w.tk.call, ('trace', 'variable', self.useBalloons, 'w',
# ToggleHelp))
+
return w
***************
*** 82,88 ****
top = self.root
w = Tix.NoteBook(top, ipadx=5, ipady=5, options="""
! *TixNoteBook*tagPadX 6
! *TixNoteBook*tagPadY 4
! *TixNoteBook*borderWidth 2
""")
# This may be required if there is no *Background option
--- 80,86 ----
top = self.root
w = Tix.NoteBook(top, ipadx=5, ipady=5, options="""
! tagPadX 6
! tagPadY 4
! borderWidth 2
""")
# This may be required if there is no *Background option
***************
*** 116,121 ****
z = root.winfo_toplevel()
z.wm_title('Tix Widget Demonstration')
! z.geometry('790x590+10+10')
!
demo.balloon = Tix.Balloon(root)
frame1 = self.MkMainMenu()
--- 114,121 ----
z = root.winfo_toplevel()
z.wm_title('Tix Widget Demonstration')
! if z.winfo_screenwidth() <= 800:
! z.geometry('790x590+10+10')
! else:
! z.geometry('890x640+10+10')
demo.balloon = Tix.Balloon(root)
frame1 = self.MkMainMenu()
***************
*** 128,131 ****
--- 128,135 ----
z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd())
+ # To show Tcl errors - uncomment this to see the listbox bug.
+ # Tkinter defines a Tcl tkerror procedure that in effect
+ # silences all background Tcl error reporting.
+ # root.tk.eval('if {[info commands tkerror] != ""} {rename tkerror pytkerror}')
def quitcmd (self):
"""Quit our mainloop. It is up to you to call root.destroy() after."""
***************
*** 133,152 ****
def loop(self):
! import tkMessageBox, traceback
while self.exit < 0:
try:
! self.root.tk.dooneevent(TCL_ALL_EVENTS)
except SystemExit:
#print 'Exit'
self.exit = 1
! break
except KeyboardInterrupt:
if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes':
# self.tk.eval('exit')
return
- else:
- pass
continue
except:
t, v, tb = sys.exc_info()
text = ""
--- 137,164 ----
def loop(self):
! """This is an explict replacement for _tkinter mainloop()
! It lets you catch keyboard interrupts easier, and avoids
! the 20 msec. dead sleep() which burns a constant CPU."""
while self.exit < 0:
+ # There are 2 whiles here. The outer one lets you continue
+ # after a ^C interrupt.
try:
! # This is the replacement for _tkinter mainloop()
! # It blocks waiting for the next Tcl event using select.
! while self.exit < 0:
! self.root.tk.dooneevent(TCL_ALL_EVENTS)
except SystemExit:
+ # Tkinter uses SystemExit to exit
#print 'Exit'
self.exit = 1
! return
except KeyboardInterrupt:
if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes':
# self.tk.eval('exit')
+ self.exit = 1
return
continue
except:
+ # Otherwise it's some other error - be nice and say why
t, v, tb = sys.exc_info()
text = ""
***************
*** 160,164 ****
def destroy (self):
self.root.destroy()
!
def RunMain(root):
global demo
--- 172,176 ----
def destroy (self):
self.root.destroy()
!
def RunMain(root):
global demo
***************
*** 255,271 ****
def MkChoosers(nb, name):
w = nb.page(name)
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! w.option_add('*' + prefix + '*TixLabelFrame*label.padX', 4)
! til = Tix.LabelFrame(w, label='Chooser Widgets')
! cbx = Tix.LabelFrame(w, label='tixComboBox')
! ctl = Tix.LabelFrame(w, label='tixControl')
! sel = Tix.LabelFrame(w, label='tixSelect')
! opt = Tix.LabelFrame(w, label='tixOptionMenu')
! fil = Tix.LabelFrame(w, label='tixFileEntry')
! fbx = Tix.LabelFrame(w, label='tixFileSelectBox')
! tbr = Tix.LabelFrame(w, label='Tool Bar')
MkTitle(til.frame)
--- 267,280 ----
def MkChoosers(nb, name):
w = nb.page(name)
! options = "label.padX 4"
! til = Tix.LabelFrame(w, label='Chooser Widgets', options=options)
! cbx = Tix.LabelFrame(w, label='tixComboBox', options=options)
! ctl = Tix.LabelFrame(w, label='tixControl', options=options)
! sel = Tix.LabelFrame(w, label='tixSelect', options=options)
! opt = Tix.LabelFrame(w, label='tixOptionMenu', options=options)
! fil = Tix.LabelFrame(w, label='tixFileEntry', options=options)
! fbx = Tix.LabelFrame(w, label='tixFileSelectBox', options=options)
! tbr = Tix.LabelFrame(w, label='Tool Bar', options=options)
MkTitle(til.frame)
***************
*** 294,307 ****
def MkCombo(w):
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixComboBox*label.width', 10)
! w.option_add('*' + prefix + '*TixComboBox*label.anchor', Tix.E)
! w.option_add('*' + prefix + '*TixComboBox*entry.width', 14)
! static = Tix.ComboBox(w, label='Static', editable=0)
! editable = Tix.ComboBox(w, label='Editable', editable=1)
history = Tix.ComboBox(w, label='History', editable=1, history=1,
! anchor=Tix.E)
static.insert(Tix.END, 'January')
static.insert(Tix.END, 'February')
--- 303,312 ----
def MkCombo(w):
! options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14)
! static = Tix.ComboBox(w, label='Static', editable=0, options=options)
! editable = Tix.ComboBox(w, label='Editable', editable=1, options=options)
history = Tix.ComboBox(w, label='History', editable=1, history=1,
! anchor=Tix.E, options=options)
static.insert(Tix.END, 'January')
static.insert(Tix.END, 'February')
***************
*** 356,369 ****
global demo_spintxt
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixControl*label.width', 10)
! w.option_add('*' + prefix + '*TixControl*label.anchor', Tix.E)
! w.option_add('*' + prefix + '*TixControl*entry.width', 13)
demo_spintxt = Tix.StringVar()
demo_spintxt.set(states[0])
! simple = Tix.Control(w, label='Numbers')
! spintxt = Tix.Control(w, label='States', variable=demo_spintxt)
spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1)
spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1)
--- 361,371 ----
global demo_spintxt
! options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13)
demo_spintxt = Tix.StringVar()
demo_spintxt.set(states[0])
! simple = Tix.Control(w, label='Numbers', options=options)
! spintxt = Tix.Control(w, label='States', variable=demo_spintxt,
! options=options)
spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1)
spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1)
***************
*** 372,385 ****
simple.pack(side=Tix.TOP, padx=5, pady=3)
spintxt.pack(side=Tix.TOP, padx=5, pady=3)
!
def MkSelect(w):
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixSelect*label.anchor', Tix.CENTER)
! w.option_add('*' + prefix + '*TixSelect*orientation', Tix.VERTICAL)
! w.option_add('*' + prefix + '*TixSelect*labelSide', Tix.TOP)
! sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1)
! sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0)
sel1.add('eat', text='Eat')
--- 374,389 ----
simple.pack(side=Tix.TOP, padx=5, pady=3)
spintxt.pack(side=Tix.TOP, padx=5, pady=3)
!
def MkSelect(w):
! options = "label.anchor %s" % Tix.CENTER
! sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
! orientation=Tix.VERTICAL,
! labelside=Tix.TOP,
! options=options)
! sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0,
! orientation=Tix.VERTICAL,
! labelside= Tix.TOP,
! options=options)
sel1.add('eat', text='Eat')
***************
*** 399,406 ****
def MkOptMenu(w):
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixOptionMenu*label.anchor', Tix.E)
! m = Tix.OptionMenu(w, label='File Format : ', options='menubutton.width 15')
m.add_command('text', label='Plain Text')
m.add_command('post', label='PostScript')
--- 403,409 ----
def MkOptMenu(w):
! options='menubutton.width 15 label.anchor %s' % Tix.E
!
! m = Tix.OptionMenu(w, label='File Format : ', options=options)
m.add_command('text', label='Plain Text')
m.add_command('post', label='PostScript')
***************
*** 414,418 ****
def MkFileEnt(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='Press the "open file" icon button and a TixFileSelectDialog will popup.')
--- 417,421 ----
def MkFileEnt(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='Press the "open file" icon button and a TixFileSelectDialog will popup.')
***************
*** 426,430 ****
and your past selections are recorded.
"""
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.')
--- 429,433 ----
and your past selections are recorded.
"""
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The Tix FileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.')
***************
*** 434,448 ****
def MkToolBar(w):
global demo
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1)
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The Select widget is also good for arranging buttons in a tool bar.')
bar = Tix.Frame(w, bd=2, relief=Tix.RAISED)
! font = Tix.Select(w, allowzero=1, radio=0, label='')
! para = Tix.Select(w, allowzero=0, radio=1, label='')
font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm')
--- 437,452 ----
def MkToolBar(w):
+ """The Select widget is also good for arranging buttons in a tool bar.
+ """
global demo
! options='frame.borderWidth 1'
!
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The Select widget is also good for arranging buttons in a tool bar.')
bar = Tix.Frame(w, bd=2, relief=Tix.RAISED)
! font = Tix.Select(w, allowzero=1, radio=0, label='', options=options)
! para = Tix.Select(w, allowzero=0, radio=1, label='', options=options)
font.add('bold', bitmap='@' + demo.dir + '/bitmaps/bold.xbm')
***************
*** 462,469 ****
def MkTitle(w):
! prefix = Tix.OptionName(w)
! if not prefix: prefix = ''
! w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1)
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='There are many types of "chooser" widgets that allow the user to input different types of information')
--- 466,470 ----
def MkTitle(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='There are many types of "chooser" widgets that allow the user to input different types of information')
***************
*** 472,483 ****
def MkScroll(nb, name):
w = nb.page(name)
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! w.option_add('*' + prefix + '*TixLabelFrame*label.padX', 4)
! sls = Tix.LabelFrame(w, label='tixScrolledListBox')
! swn = Tix.LabelFrame(w, label='tixScrolledWindow')
! stx = Tix.LabelFrame(w, label='tixScrolledText')
MkSList(sls.frame)
--- 473,481 ----
def MkScroll(nb, name):
w = nb.page(name)
! options='label.padX 4'
! sls = Tix.LabelFrame(w, label='tixScrolledListBox', options=options)
! swn = Tix.LabelFrame(w, label='tixScrolledWindow', options=options)
! stx = Tix.LabelFrame(w, label='tixScrolledText', options=options)
MkSList(sls.frame)
***************
*** 489,496 ****
stx.form(top=0, left=swn, right=-1, bottom=-1)
def MkSList(w):
top = Tix.Frame(w, width=300, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.')
--- 487,498 ----
stx.form(top=0, left=swn, right=-1, bottom=-1)
+
def MkSList(w):
+ """This TixScrolledListBox is configured so that it uses scrollbars
+ only when it is necessary. Use the handles to resize the listbox and
+ watch the scrollbars automatically appear and disappear. """
top = Tix.Frame(w, width=300, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.')
***************
*** 523,534 ****
rh.attach_widget(list)
- # See below why this is necessary.
- global image1
- image1 = None
def MkSWindow(w):
! global demo, image1
- text = 'The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.'
-
file = os.path.join(demo.dir, 'bitmaps', 'tix.gif')
if not os.path.isfile(file):
--- 525,536 ----
rh.attach_widget(list)
def MkSWindow(w):
! """The ScrolledWindow widget allows you to scroll any kind of Tk
! widget. It is more versatile than a scrolled canvas widget.
! """
! global demo
!
! text = 'The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.'
file = os.path.join(demo.dir, 'bitmaps', 'tix.gif')
if not os.path.isfile(file):
***************
*** 537,541 ****
top = Tix.Frame(w, width=330, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
text=text)
--- 539,543 ----
top = Tix.Frame(w, width=330, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
text=text)
***************
*** 543,550 ****
win = Tix.ScrolledWindow(top, scrollbar='auto')
! # This image is not showing up under Python unless it is set to a
! # global variable - no problem under Tcl. I assume it is being garbage
! # collected some how, even though the tcl command 'image names' shows
! # that as far as Tcl is concerned, the image exists and is called pyimage1.
image1 = Tix.Image('photo', file=file)
lbl = Tix.Label(win.window, image=image1)
--- 545,552 ----
win = Tix.ScrolledWindow(top, scrollbar='auto')
! global image1
! # This image is not showing up in the Label unless it is set to a
! # global variable - no problem under Tcl/Tix. It is being
! # garbage collected at the end of this proecedure if not global
image1 = Tix.Image('photo', file=file)
lbl = Tix.Label(win.window, image=image1)
***************
*** 562,567 ****
top.pack(expand=1, fill=Tix.BOTH)
bot.pack(fill=Tix.BOTH)
- win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
- win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
def SWindow_reset(rh, win):
--- 564,567 ----
***************
*** 571,579 ****
def MkSText(w):
top = Tix.Frame(w, width=330, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
! text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
win = Tix.ScrolledText(top, scrollbar='auto')
--- 571,581 ----
def MkSText(w):
+ """The TixScrolledWindow widget allows you to scroll any kind of Tk
+ widget. It is more versatile than a scrolled canvas widget."""
top = Tix.Frame(w, width=330, height=330)
bot = Tix.Frame(w)
! msg = Tix.Message(top,
relief=Tix.FLAT, width=200, anchor=Tix.N,
! text='The Tix ScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.')
win = Tix.ScrolledText(top, scrollbar='auto')
***************
*** 601,611 ****
def MkManager(nb, name):
w = nb.page(name)
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! w.option_add('*' + prefix + '*TixLabelFrame*label.padX', 4)
! pane = Tix.LabelFrame(w, label='tixPanedWindow')
! note = Tix.LabelFrame(w, label='tixNoteBook')
MkPanedWindow(pane.frame)
--- 603,610 ----
def MkManager(nb, name):
w = nb.page(name)
! options='label.padX 4'
! pane = Tix.LabelFrame(w, label='tixPanedWindow', options=options)
! note = Tix.LabelFrame(w, label='tixNoteBook', options=options)
MkPanedWindow(pane.frame)
***************
*** 616,620 ****
def MkPanedWindow(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.')
--- 615,623 ----
def MkPanedWindow(w):
! """The PanedWindow widget allows the user to interactively manipulate
! the sizes of several panes. The panes can be arranged either vertically
! or horizontally.
! """
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.')
***************
*** 659,674 ****
def MkNoteBook(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The NoteBook widget allows you to layout a complex interface into individual pages.')
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! w.option_add('*' + prefix + '*TixControl*entry.width', 10)
! w.option_add('*' + prefix + '*TixControl*label.width', 18)
! w.option_add('*' + prefix + '*TixControl*label.anchor', Tix.E)
! w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8)
! nb = Tix.NoteBook(w, ipadx=6, ipady=6)
nb.add('hard_disk', label="Hard Disk", underline=0)
nb.add('network', label="Network", underline=0)
--- 662,674 ----
def MkNoteBook(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
text='The NoteBook widget allows you to layout a complex interface into individual pages.')
! # prefix = Tix.OptionName(w)
! # if not prefix: prefix = ''
! # w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8)
! options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E)
! nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options)
nb.add('hard_disk', label="Hard Disk", underline=0)
nb.add('network', label="Network", underline=0)
***************
*** 715,725 ****
def MkDirList(nb, name):
w = nb.page(name)
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! w.option_add('*' + prefix + '*TixLabelFrame*label.padX', 4)
! dir = Tix.LabelFrame(w, label='tixDirList')
! fsbox = Tix.LabelFrame(w, label='tixExFileSelectBox')
MkDirListWidget(dir.frame)
MkExFileWidget(fsbox.frame)
--- 715,722 ----
def MkDirList(nb, name):
w = nb.page(name)
! options = "label.padX 4"
! dir = Tix.LabelFrame(w, label='tixDirList', options=options)
! fsbox = Tix.LabelFrame(w, label='tixExFileSelectBox', options=options)
MkDirListWidget(dir.frame)
MkExFileWidget(fsbox.frame)
***************
*** 728,734 ****
def MkDirListWidget(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
! text='The TixDirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.')
dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
--- 725,735 ----
def MkDirListWidget(w):
! """The TixDirList widget gives a graphical representation of the file
! system directory and makes it easy for the user to choose and access
! directories.
! """
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
! text='The Tix DirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.')
dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
***************
*** 736,742 ****
def MkExFileWidget(w):
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
! text='The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.')
# There's a bug in the ComboBoxes - the scrolledlistbox is destroyed
box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED)
--- 737,745 ----
def MkExFileWidget(w):
! """The TixExFileSelectBox widget is more user friendly than the Motif
! style FileSelectBox. """
! msg = Tix.Message(w,
relief=Tix.FLAT, width=240, anchor=Tix.N,
! text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.')
# There's a bug in the ComboBoxes - the scrolledlistbox is destroyed
box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED)
***************
*** 774,795 ****
## {d "Image Types" image }
## }
! ##
## set image {
## {d "Compound Image" cmpimg }
## {d "XPM Image" xpm {i pixmap}}
## }
! ##
## set cmpimg {
! ## {f "In Buttons" CmpImg.tcl }
## {f "In NoteBook" CmpImg2.tcl }
## {f "Notebook Color Tabs" CmpImg4.tcl }
## {f "Icons" CmpImg3.tcl }
## }
! ##
## set xpm {
## {f "In Button" Xpm.tcl {i pixmap}}
## {f "In Menu" Xpm1.tcl {i pixmap}}
## }
! ##
## set file {
##added {f DirList DirList.tcl }
--- 777,798 ----
## {d "Image Types" image }
## }
! ##
## set image {
## {d "Compound Image" cmpimg }
## {d "XPM Image" xpm {i pixmap}}
## }
! ##
## set cmpimg {
! ##done {f "In Buttons" CmpImg.tcl }
## {f "In NoteBook" CmpImg2.tcl }
## {f "Notebook Color Tabs" CmpImg4.tcl }
## {f "Icons" CmpImg3.tcl }
## }
! ##
## set xpm {
## {f "In Button" Xpm.tcl {i pixmap}}
## {f "In Menu" Xpm1.tcl {i pixmap}}
## }
! ##
## set file {
##added {f DirList DirList.tcl }
***************
*** 800,804 ****
## {f FileEntry FileEnt.tcl }
## }
! ##
## set hlist {
## {f HList HList1.tcl }
--- 803,807 ----
## {f FileEntry FileEnt.tcl }
## }
! ##
## set hlist {
## {f HList HList1.tcl }
***************
*** 809,813 ****
##done {f "Tree (Dynamic)" DynTree.tcl {v win}}
## }
! ##
## set tlist {
## {f "ScrolledTList (1)" STList1.tcl {c tixTList}}
--- 812,816 ----
##done {f "Tree (Dynamic)" DynTree.tcl {v win}}
## }
! ##
## set tlist {
## {f "ScrolledTList (1)" STList1.tcl {c tixTList}}
***************
*** 819,823 ****
##na lappend tlist {f "TList File Viewer" STList3.tcl {c tixTList}}
## }
! ##
## set grid {
##na {f "Simple Grid" SGrid0.tcl {c tixGrid}}
--- 822,826 ----
##na lappend tlist {f "TList File Viewer" STList3.tcl {c tixTList}}
## }
! ##
## set grid {
##na {f "Simple Grid" SGrid0.tcl {c tixGrid}}
***************
*** 825,829 ****
##na {f "Editable Grid" EditGrid.tcl {c tixGrid}}
## }
! ##
## set scroll {
## {f ScrolledListBox SListBox.tcl }
--- 828,832 ----
##na {f "Editable Grid" EditGrid.tcl {c tixGrid}}
## }
! ##
## set scroll {
## {f ScrolledListBox SListBox.tcl }
***************
*** 832,842 ****
##na {f "Canvas Object View" CObjView.tcl {c tixCObjView}}
## }
! ##
## set manager {
! ##na {f ListNoteBook ListNBK.tcl }
##done {f NoteBook NoteBook.tcl }
##done {f PanedWindow PanedWin.tcl }
## }
! ##
## set misc {
##done {f Balloon Balloon.tcl }
--- 835,845 ----
##na {f "Canvas Object View" CObjView.tcl {c tixCObjView}}
## }
! ##
## set manager {
! ## {f ListNoteBook ListNBK.tcl }
##done {f NoteBook NoteBook.tcl }
##done {f PanedWindow PanedWin.tcl }
## }
! ##
## set misc {
##done {f Balloon Balloon.tcl }
***************
*** 846,850 ****
## {f LabelEntry LabEntry.tcl }
## {f LabelFrame LabFrame.tcl }
! ##na {f Meter Meter.tcl {c tixMeter}}
##done {f OptionMenu OptMenu.tcl }
##done {f PopupMenu PopMenu.tcl }
--- 849,853 ----
## {f LabelEntry LabEntry.tcl }
## {f LabelFrame LabFrame.tcl }
! ## {f Meter Meter.tcl {c tixMeter}}
##done {f OptionMenu OptMenu.tcl }
##done {f PopupMenu PopMenu.tcl }
***************
*** 863,872 ****
def MkSample(nb, name):
w = nb.page(name)
! prefix = Tix.OptionName(w)
! if not prefix:
! prefix = ''
! else:
! prefix = '*' + prefix
! w.option_add(prefix + '*TixLabelFrame*label.padX', 4)
pane = Tix.PanedWindow(w, orientation='horizontal')
--- 866,870 ----
def MkSample(nb, name):
w = nb.page(name)
! options = "label.padX 4"
pane = Tix.PanedWindow(w, orientation='horizontal')
***************
*** 877,899 ****
f2['relief'] = 'flat'
! lab = Tix.Label(f1, text='Select a sample program:', anchor=Tix.W)
! lab.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=5, pady=5)
! lab1 = Tix.Label(f2, text='Source:', anchor=Tix.W)
! lab1.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=5, pady=5)
! slb = Tix.Tree(f1, options='hlist.width 25')
slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5)
! stext = Tix.ScrolledText(f2, name='stext')
font = root.tk.eval('tix option get fixed_font')
stext.text.config(font=font)
- stext.text.bind('<Up>', lambda w=stext.text: w.yview(scroll='-1 unit'))
- stext.text.bind('<Down>', lambda w=stext.text: w.yview(scroll='1 unit'))
- stext.text.bind('<Left>', lambda w=stext.text: w.xview(scroll='-1 unit'))
- stext.text.bind('<Right>', lambda w=stext.text: w.xview(scroll='1 unit'))
- stext.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=7)
! frame = Tix.Frame(f2, name='frame')
! frame.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=7)
run = Tix.Button(frame, text='Run ...', name='run')
--- 875,891 ----
f2['relief'] = 'flat'
! lab = Tix.LabelFrame(f1, label='Select a sample program:')
! lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
! lab1 = Tix.LabelFrame(f2, label='Source:')
! lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
! slb = Tix.Tree(lab.frame, options='hlist.width 20')
slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5)
! stext = Tix.ScrolledText(lab1.frame, name='stext')
font = root.tk.eval('tix option get fixed_font')
stext.text.config(font=font)
! frame = Tix.Frame(lab1.frame, name='frame')
run = Tix.Button(frame, text='Run ...', name='run')
***************
*** 906,909 ****
--- 898,904 ----
stext.text['wrap'] = 'none'
stext.text['width'] = 80
+
+ frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7)
+ stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7)
slb.hlist['separator'] = '.'