301
301
fbx.form(right=-1, top=0, left='%66')
304
options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 14)
306
static = Tix.ComboBox(w, label='Static', editable=0, options=options)
307
editable = Tix.ComboBox(w, label='Editable', editable=1, options=options)
308
history = Tix.ComboBox(w, label='History', editable=1, history=1,
309
anchor=Tix.E, options=options)
310
static.insert(Tix.END, 'January')
311
static.insert(Tix.END, 'February')
312
static.insert(Tix.END, 'March')
313
static.insert(Tix.END, 'April')
314
static.insert(Tix.END, 'May')
315
static.insert(Tix.END, 'June')
316
static.insert(Tix.END, 'July')
317
static.insert(Tix.END, 'August')
318
static.insert(Tix.END, 'September')
319
static.insert(Tix.END, 'October')
320
static.insert(Tix.END, 'November')
321
static.insert(Tix.END, 'December')
323
editable.insert(Tix.END, 'Angola')
324
editable.insert(Tix.END, 'Bangladesh')
325
editable.insert(Tix.END, 'China')
326
editable.insert(Tix.END, 'Denmark')
327
editable.insert(Tix.END, 'Ecuador')
329
history.insert(Tix.END, '/usr/bin/ksh')
330
history.insert(Tix.END, '/usr/local/lib/python')
331
history.insert(Tix.END, '/var/adm')
333
static.pack(side=Tix.TOP, padx=5, pady=3)
334
editable.pack(side=Tix.TOP, padx=5, pady=3)
335
history.pack(side=Tix.TOP, padx=5, pady=3)
304
options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 14)
306
static = tkinter.tix.ComboBox(w, label='Static', editable=0, options=options)
307
editable = tkinter.tix.ComboBox(w, label='Editable', editable=1, options=options)
308
history = tkinter.tix.ComboBox(w, label='History', editable=1, history=1,
309
anchor=tkinter.tix.E, options=options)
310
static.insert(tkinter.tix.END, 'January')
311
static.insert(tkinter.tix.END, 'February')
312
static.insert(tkinter.tix.END, 'March')
313
static.insert(tkinter.tix.END, 'April')
314
static.insert(tkinter.tix.END, 'May')
315
static.insert(tkinter.tix.END, 'June')
316
static.insert(tkinter.tix.END, 'July')
317
static.insert(tkinter.tix.END, 'August')
318
static.insert(tkinter.tix.END, 'September')
319
static.insert(tkinter.tix.END, 'October')
320
static.insert(tkinter.tix.END, 'November')
321
static.insert(tkinter.tix.END, 'December')
323
editable.insert(tkinter.tix.END, 'Angola')
324
editable.insert(tkinter.tix.END, 'Bangladesh')
325
editable.insert(tkinter.tix.END, 'China')
326
editable.insert(tkinter.tix.END, 'Denmark')
327
editable.insert(tkinter.tix.END, 'Ecuador')
329
history.insert(tkinter.tix.END, '/usr/bin/ksh')
330
history.insert(tkinter.tix.END, '/usr/local/lib/python')
331
history.insert(tkinter.tix.END, '/var/adm')
333
static.pack(side=tkinter.tix.TOP, padx=5, pady=3)
334
editable.pack(side=tkinter.tix.TOP, padx=5, pady=3)
335
history.pack(side=tkinter.tix.TOP, padx=5, pady=3)
337
337
states = ['Bengal', 'Delhi', 'Karnataka', 'Tamil Nadu']
359
359
def MkControl(w):
360
360
global demo_spintxt
362
options="label.width %d label.anchor %s entry.width %d" % (10, Tix.E, 13)
362
options="label.width %d label.anchor %s entry.width %d" % (10, tkinter.tix.E, 13)
364
demo_spintxt = Tix.StringVar()
364
demo_spintxt = tkinter.tix.StringVar()
365
365
demo_spintxt.set(states[0])
366
simple = Tix.Control(w, label='Numbers', options=options)
367
spintxt = Tix.Control(w, label='States', variable=demo_spintxt,
366
simple = tkinter.tix.Control(w, label='Numbers', options=options)
367
spintxt = tkinter.tix.Control(w, label='States', variable=demo_spintxt,
369
369
spintxt['incrcmd'] = lambda w=spintxt: spin_cmd(w, 1)
370
370
spintxt['decrcmd'] = lambda w=spintxt: spin_cmd(w, -1)
371
371
spintxt['validatecmd'] = lambda w=spintxt: spin_validate(w)
373
simple.pack(side=Tix.TOP, padx=5, pady=3)
374
spintxt.pack(side=Tix.TOP, padx=5, pady=3)
373
simple.pack(side=tkinter.tix.TOP, padx=5, pady=3)
374
spintxt.pack(side=tkinter.tix.TOP, padx=5, pady=3)
377
options = "label.anchor %s" % Tix.CENTER
377
options = "label.anchor %s" % tkinter.tix.CENTER
379
sel1 = Tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
380
orientation=Tix.VERTICAL,
379
sel1 = tkinter.tix.Select(w, label='Mere Mortals', allowzero=1, radio=1,
380
orientation=tkinter.tix.VERTICAL,
381
labelside=tkinter.tix.TOP,
383
sel2 = Tix.Select(w, label='Geeks', allowzero=1, radio=0,
384
orientation=Tix.VERTICAL,
383
sel2 = tkinter.tix.Select(w, label='Geeks', allowzero=1, radio=0,
384
orientation=tkinter.tix.VERTICAL,
385
labelside= tkinter.tix.TOP,
388
388
sel1.add('eat', text='Eat')
412
412
m.add_command('tex', label='LaTeX')
413
413
m.add_command('rtf', label='Rich Text Format')
415
m.pack(fill=Tix.X, padx=5, pady=3)
415
m.pack(fill=tkinter.tix.X, padx=5, pady=3)
417
417
def MkFileEnt(w):
419
relief=Tix.FLAT, width=240, anchor=Tix.N,
418
msg = tkinter.tix.Message(w,
419
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
420
420
text='Press the "open file" icon button and a TixFileSelectDialog will popup.')
421
ent = Tix.FileEntry(w, label='Select a file : ')
422
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
423
ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
421
ent = tkinter.tix.FileEntry(w, label='Select a file : ')
422
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
423
ent.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
425
425
def MkFileBox(w):
426
426
"""The FileSelectBox is a Motif-style box with various enhancements.
427
427
For example, you can adjust the size of the two listboxes
428
428
and your past selections are recorded.
431
relief=Tix.FLAT, width=240, anchor=Tix.N,
430
msg = tkinter.tix.Message(w,
431
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
432
432
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.')
433
box = Tix.FileSelectBox(w)
434
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
435
box.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
433
box = tkinter.tix.FileSelectBox(w)
434
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
435
box.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
437
437
def MkToolBar(w):
438
438
"""The Select widget is also good for arranging buttons in a tool bar.
458
458
para.add('center', bitmap='@' + demo.dir + '/bitmaps/centerj.xbm')
459
459
para.add('justify', bitmap='@' + demo.dir + '/bitmaps/justify.xbm')
461
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
462
bar.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
463
font.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3)
464
para.pack({'in':bar}, side=Tix.LEFT, padx=3, pady=3)
461
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
462
bar.pack(side=tkinter.tix.TOP, fill=tkinter.tix.X, padx=3, pady=3)
463
font.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
464
para.pack({'in':bar}, side=tkinter.tix.LEFT, padx=3, pady=3)
468
relief=Tix.FLAT, width=240, anchor=Tix.N,
467
msg = tkinter.tix.Message(w,
468
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
469
469
text='There are many types of "chooser" widgets that allow the user to input different types of information')
470
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
470
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
472
472
def MkScroll(nb, name):
473
473
w = nb.page(name)
474
474
options='label.padX 4'
476
sls = Tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options)
477
swn = Tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options)
478
stx = Tix.LabelFrame(w, label='Tix.ScrolledText', options=options)
476
sls = tkinter.tix.LabelFrame(w, label='Tix.ScrolledListBox', options=options)
477
swn = tkinter.tix.LabelFrame(w, label='Tix.ScrolledWindow', options=options)
478
stx = tkinter.tix.LabelFrame(w, label='Tix.ScrolledText', options=options)
480
480
MkSList(sls.frame)
481
481
MkSWindow(swn.frame)
490
490
"""This TixScrolledListBox is configured so that it uses scrollbars
491
491
only when it is necessary. Use the handles to resize the listbox and
492
492
watch the scrollbars automatically appear and disappear. """
493
top = Tix.Frame(w, width=300, height=330)
495
msg = Tix.Message(top,
496
relief=Tix.FLAT, width=200, anchor=Tix.N,
493
top = tkinter.tix.Frame(w, width=300, height=330)
494
bot = tkinter.tix.Frame(w)
495
msg = tkinter.tix.Message(top,
496
relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
497
497
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.')
499
list = Tix.ScrolledListBox(top, scrollbar='auto')
499
list = tkinter.tix.ScrolledListBox(top, scrollbar='auto')
500
500
list.place(x=50, y=150, width=120, height=80)
501
list.listbox.insert(Tix.END, 'Alabama')
502
list.listbox.insert(Tix.END, 'California')
503
list.listbox.insert(Tix.END, 'Montana')
504
list.listbox.insert(Tix.END, 'New Jersey')
505
list.listbox.insert(Tix.END, 'New York')
506
list.listbox.insert(Tix.END, 'Pennsylvania')
507
list.listbox.insert(Tix.END, 'Washington')
501
list.listbox.insert(tkinter.tix.END, 'Alabama')
502
list.listbox.insert(tkinter.tix.END, 'California')
503
list.listbox.insert(tkinter.tix.END, 'Montana')
504
list.listbox.insert(tkinter.tix.END, 'New Jersey')
505
list.listbox.insert(tkinter.tix.END, 'New York')
506
list.listbox.insert(tkinter.tix.END, 'Pennsylvania')
507
list.listbox.insert(tkinter.tix.END, 'Washington')
509
rh = Tix.ResizeHandle(top, bg='black',
509
rh = tkinter.tix.ResizeHandle(top, bg='black',
510
relief=tkinter.tix.RAISED,
511
511
handlesize=8, gridded=1, minwidth=50, minheight=30)
512
btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x))
512
btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=list: SList_reset(w,x))
515
btn.pack(anchor=Tix.CENTER)
516
top.pack(expand=1, fill=Tix.BOTH)
517
bot.pack(fill=Tix.BOTH)
514
msg.pack(fill=tkinter.tix.X)
515
btn.pack(anchor=tkinter.tix.CENTER)
516
top.pack(expand=1, fill=tkinter.tix.BOTH)
517
bot.pack(fill=tkinter.tix.BOTH)
518
518
list.bind('<Map>', func=lambda arg=0, rh=rh, list=list:
519
519
list.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(list)))
535
535
if not os.path.isfile(file):
536
536
text += ' (Image missing)'
538
top = Tix.Frame(w, width=330, height=330)
540
msg = Tix.Message(top,
541
relief=Tix.FLAT, width=200, anchor=Tix.N,
538
top = tkinter.tix.Frame(w, width=330, height=330)
539
bot = tkinter.tix.Frame(w)
540
msg = tkinter.tix.Message(top,
541
relief=tkinter.tix.FLAT, width=200, anchor=tkinter.tix.N,
544
win = Tix.ScrolledWindow(top, scrollbar='auto')
544
win = tkinter.tix.ScrolledWindow(top, scrollbar='auto')
546
546
image1 = win.window.image_create('photo', file=file)
547
lbl = Tix.Label(win.window, image=image1)
548
lbl.pack(expand=1, fill=Tix.BOTH)
547
lbl = tkinter.tix.Label(win.window, image=image1)
548
lbl.pack(expand=1, fill=tkinter.tix.BOTH)
550
550
win.place(x=30, y=150, width=190, height=120)
552
rh = Tix.ResizeHandle(top, bg='black',
552
rh = tkinter.tix.ResizeHandle(top, bg='black',
553
relief=tkinter.tix.RAISED,
554
554
handlesize=8, gridded=1, minwidth=50, minheight=30)
555
btn = Tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x))
555
btn = tkinter.tix.Button(bot, text='Reset', command=lambda w=rh, x=win: SWindow_reset(w,x))
558
btn.pack(anchor=Tix.CENTER)
559
top.pack(expand=1, fill=Tix.BOTH)
560
bot.pack(fill=Tix.BOTH)
557
msg.pack(fill=tkinter.tix.X)
558
btn.pack(anchor=tkinter.tix.CENTER)
559
top.pack(expand=1, fill=tkinter.tix.BOTH)
560
bot.pack(fill=tkinter.tix.BOTH)
562
562
win.bind('<Map>', func=lambda arg=0, rh=rh, win=win:
563
563
win.tk.call('tixDoWhenIdle', str(rh), 'attachwidget', str(win)))
626
626
the sizes of several panes. The panes can be arranged either vertically
630
relief=Tix.FLAT, width=240, anchor=Tix.N,
629
msg = tkinter.tix.Message(w,
630
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
631
631
text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.')
632
group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
632
group = tkinter.tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25')
633
633
group.entry.insert(0,'comp.lang.python')
634
pane = Tix.PanedWindow(w, orientation='vertical')
634
pane = tkinter.tix.PanedWindow(w, orientation='vertical')
636
636
p1 = pane.add('list', min=70, size=100)
637
637
p2 = pane.add('text', min=70)
638
list = Tix.ScrolledListBox(p1)
639
text = Tix.ScrolledText(p2)
638
list = tkinter.tix.ScrolledListBox(p1)
639
text = tkinter.tix.ScrolledText(p2)
641
list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health")
642
list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health")
643
list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
644
list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
645
list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
646
list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
647
list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
641
list.listbox.insert(tkinter.tix.END, " 12324 Re: Tkinter is good for your health")
642
list.listbox.insert(tkinter.tix.END, "+ 12325 Re: Tkinter is good for your health")
643
list.listbox.insert(tkinter.tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)")
644
list.listbox.insert(tkinter.tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)")
645
list.listbox.insert(tkinter.tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)")
646
list.listbox.insert(tkinter.tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)")
647
list.listbox.insert(tkinter.tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)")
649
649
text.text['bg'] = list.listbox['bg']
650
650
text.text['wrap'] = 'none'
651
text.text.insert(Tix.END, """
651
text.text.insert(tkinter.tix.END, """
652
652
Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220
653
653
Lines 353 A new way to put text and bitmaps together iNo responses
654
654
ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania
661
661
support the -image option. For example, you can display a text string string
662
662
together with a bitmap, at the same time, inside a TK button widget.
664
list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
665
text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6)
664
list.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
665
text.pack(expand=1, fill=tkinter.tix.BOTH, padx=4, pady=6)
667
msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
668
group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
669
pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1)
667
msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
668
group.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
669
pane.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH, expand=1)
671
671
def MkNoteBook(w):
673
relief=Tix.FLAT, width=240, anchor=Tix.N,
672
msg = tkinter.tix.Message(w,
673
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
674
674
text='The NoteBook widget allows you to layout a complex interface into individual pages.')
675
675
# prefix = Tix.OptionName(w)
676
676
# if not prefix: prefix = ''
677
677
# w.option_add('*' + prefix + '*TixNoteBook*tagPadX', 8)
678
options = "entry.width %d label.width %d label.anchor %s" % (10, 18, Tix.E)
678
options = "entry.width %d label.width %d label.anchor %s" % (10, 18, tkinter.tix.E)
680
nb = Tix.NoteBook(w, ipadx=6, ipady=6, options=options)
680
nb = tkinter.tix.NoteBook(w, ipadx=6, ipady=6, options=options)
681
681
nb.add('hard_disk', label="Hard Disk", underline=0)
682
682
nb.add('network', label="Network", underline=0)
684
684
# Frame for the buttons that are present on all pages
685
common = Tix.Frame(nb.hard_disk)
686
common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y)
685
common = tkinter.tix.Frame(nb.hard_disk)
686
common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
687
687
CreateCommonButtons(common)
689
689
# Widgets belonging only to this page
690
a = Tix.Control(nb.hard_disk, value=12, label='Access Time: ')
691
w = Tix.Control(nb.hard_disk, value=400, label='Write Throughput: ')
692
r = Tix.Control(nb.hard_disk, value=400, label='Read Throughput: ')
693
c = Tix.Control(nb.hard_disk, value=1021, label='Capacity: ')
694
a.pack(side=Tix.TOP, padx=20, pady=2)
695
w.pack(side=Tix.TOP, padx=20, pady=2)
696
r.pack(side=Tix.TOP, padx=20, pady=2)
697
c.pack(side=Tix.TOP, padx=20, pady=2)
690
a = tkinter.tix.Control(nb.hard_disk, value=12, label='Access Time: ')
691
w = tkinter.tix.Control(nb.hard_disk, value=400, label='Write Throughput: ')
692
r = tkinter.tix.Control(nb.hard_disk, value=400, label='Read Throughput: ')
693
c = tkinter.tix.Control(nb.hard_disk, value=1021, label='Capacity: ')
694
a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
695
w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
696
r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
697
c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
699
common = Tix.Frame(nb.network)
700
common.pack(side=Tix.RIGHT, padx=2, pady=2, fill=Tix.Y)
699
common = tkinter.tix.Frame(nb.network)
700
common.pack(side=tkinter.tix.RIGHT, padx=2, pady=2, fill=tkinter.tix.Y)
701
701
CreateCommonButtons(common)
703
a = Tix.Control(nb.network, value=12, label='Access Time: ')
704
w = Tix.Control(nb.network, value=400, label='Write Throughput: ')
705
r = Tix.Control(nb.network, value=400, label='Read Throughput: ')
706
c = Tix.Control(nb.network, value=1021, label='Capacity: ')
707
u = Tix.Control(nb.network, value=10, label='Users: ')
708
a.pack(side=Tix.TOP, padx=20, pady=2)
709
w.pack(side=Tix.TOP, padx=20, pady=2)
710
r.pack(side=Tix.TOP, padx=20, pady=2)
711
c.pack(side=Tix.TOP, padx=20, pady=2)
712
u.pack(side=Tix.TOP, padx=20, pady=2)
703
a = tkinter.tix.Control(nb.network, value=12, label='Access Time: ')
704
w = tkinter.tix.Control(nb.network, value=400, label='Write Throughput: ')
705
r = tkinter.tix.Control(nb.network, value=400, label='Read Throughput: ')
706
c = tkinter.tix.Control(nb.network, value=1021, label='Capacity: ')
707
u = tkinter.tix.Control(nb.network, value=10, label='Users: ')
708
a.pack(side=tkinter.tix.TOP, padx=20, pady=2)
709
w.pack(side=tkinter.tix.TOP, padx=20, pady=2)
710
r.pack(side=tkinter.tix.TOP, padx=20, pady=2)
711
c.pack(side=tkinter.tix.TOP, padx=20, pady=2)
712
u.pack(side=tkinter.tix.TOP, padx=20, pady=2)
714
msg.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH)
715
nb.pack(side=Tix.TOP, padx=5, pady=5, fill=Tix.BOTH, expand=1)
714
msg.pack(side=tkinter.tix.TOP, padx=3, pady=3, fill=tkinter.tix.BOTH)
715
nb.pack(side=tkinter.tix.TOP, padx=5, pady=5, fill=tkinter.tix.BOTH, expand=1)
717
717
def CreateCommonButtons(f):
718
ok = Tix.Button(f, text='OK', width = 6)
719
cancel = Tix.Button(f, text='Cancel', width = 6)
720
ok.pack(side=Tix.TOP, padx=2, pady=2)
721
cancel.pack(side=Tix.TOP, padx=2, pady=2)
718
ok = tkinter.tix.Button(f, text='OK', width = 6)
719
cancel = tkinter.tix.Button(f, text='Cancel', width = 6)
720
ok.pack(side=tkinter.tix.TOP, padx=2, pady=2)
721
cancel.pack(side=tkinter.tix.TOP, padx=2, pady=2)
723
723
def MkDirList(nb, name):
724
724
w = nb.page(name)
725
725
options = "label.padX 4"
727
dir = Tix.LabelFrame(w, label='Tix.DirList', options=options)
728
fsbox = Tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options)
727
dir = tkinter.tix.LabelFrame(w, label='Tix.DirList', options=options)
728
fsbox = tkinter.tix.LabelFrame(w, label='Tix.ExFileSelectBox', options=options)
729
729
MkDirListWidget(dir.frame)
730
730
MkExFileWidget(fsbox.frame)
731
731
dir.form(top=0, left=0, right='%40', bottom=-1)
736
736
system directory and makes it easy for the user to choose and access
740
relief=Tix.FLAT, width=240, anchor=Tix.N,
739
msg = tkinter.tix.Message(w,
740
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
741
741
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.')
742
dirlist = Tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
743
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
744
dirlist.pack(side=Tix.TOP, padx=3, pady=3)
742
dirlist = tkinter.tix.DirList(w, options='hlist.padY 1 hlist.width 25 hlist.height 16')
743
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
744
dirlist.pack(side=tkinter.tix.TOP, padx=3, pady=3)
746
746
def MkExFileWidget(w):
747
747
"""The TixExFileSelectBox widget is more user friendly than the Motif
748
748
style FileSelectBox. """
750
relief=Tix.FLAT, width=240, anchor=Tix.N,
749
msg = tkinter.tix.Message(w,
750
relief=tkinter.tix.FLAT, width=240, anchor=tkinter.tix.N,
751
751
text='The Tix ExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.')
752
752
# There's a bug in the ComboBoxes - the scrolledlistbox is destroyed
753
box = Tix.ExFileSelectBox(w, bd=2, relief=Tix.RAISED)
754
msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3)
755
box.pack(side=Tix.TOP, padx=3, pady=3)
753
box = tkinter.tix.ExFileSelectBox(w, bd=2, relief=tkinter.tix.RAISED)
754
msg.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=3, pady=3)
755
box.pack(side=tkinter.tix.TOP, padx=3, pady=3)
758
758
### List of all the demos we want to show off
875
875
w = nb.page(name)
876
876
options = "label.padX 4"
878
pane = Tix.PanedWindow(w, orientation='horizontal')
879
pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH)
878
pane = tkinter.tix.PanedWindow(w, orientation='horizontal')
879
pane.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH)
880
880
f1 = pane.add('list', expand='1')
881
881
f2 = pane.add('text', expand='5')
882
882
f1['relief'] = 'flat'
883
883
f2['relief'] = 'flat'
885
lab = Tix.LabelFrame(f1, label='Select a sample program:')
886
lab.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
887
lab1 = Tix.LabelFrame(f2, label='Source:')
888
lab1.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5, pady=5)
890
slb = Tix.Tree(lab.frame, options='hlist.width 20')
891
slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5)
893
stext = Tix.ScrolledText(lab1.frame, name='stext')
885
lab = tkinter.tix.LabelFrame(f1, label='Select a sample program:')
886
lab.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
887
lab1 = tkinter.tix.LabelFrame(f2, label='Source:')
888
lab1.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5, pady=5)
890
slb = tkinter.tix.Tree(lab.frame, options='hlist.width 20')
891
slb.pack(side=tkinter.tix.TOP, expand=1, fill=tkinter.tix.BOTH, padx=5)
893
stext = tkinter.tix.ScrolledText(lab1.frame, name='stext')
894
894
font = root.tk.eval('tix option get fixed_font')
895
895
stext.text.config(font=font)
897
frame = Tix.Frame(lab1.frame, name='frame')
897
frame = tkinter.tix.Frame(lab1.frame, name='frame')
899
run = Tix.Button(frame, text='Run ...', name='run')
900
view = Tix.Button(frame, text='View Source ...', name='view')
901
run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE)
902
view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE)
899
run = tkinter.tix.Button(frame, text='Run ...', name='run')
900
view = tkinter.tix.Button(frame, text='View Source ...', name='view')
901
run.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
902
view.pack(side=tkinter.tix.LEFT, expand=0, fill=tkinter.tix.NONE)
904
904
stext.text['bg'] = slb.hlist['bg']
905
905
stext.text['state'] = 'disabled'
906
906
stext.text['wrap'] = 'none'
907
907
stext.text['width'] = 80
909
frame.pack(side=Tix.BOTTOM, expand=0, fill=Tix.X, padx=7)
910
stext.pack(side=Tix.TOP, expand=0, fill=Tix.BOTH, padx=7)
909
frame.pack(side=tkinter.tix.BOTTOM, expand=0, fill=tkinter.tix.X, padx=7)
910
stext.pack(side=tkinter.tix.TOP, expand=0, fill=tkinter.tix.BOTH, padx=7)
912
912
slb.hlist['separator'] = '.'
913
913
slb.hlist['width'] = 25