2003-07-31 16:52:40 -04:00
|
|
|
|
#
|
|
|
|
|
# entry (with scrollbars) widget demo (called by 'widget')
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# toplevel widget <20><>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if defined?($entry2_demo) && $entry2_demo
|
|
|
|
|
$entry2_demo.destroy
|
|
|
|
|
$entry2_demo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# demo <20>Ѥ<EFBFBD> toplevel widget <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$entry2_demo = TkToplevel.new {|w|
|
|
|
|
|
title("Entry Demonstration (with scrollbars)")
|
|
|
|
|
iconname("entry2")
|
|
|
|
|
positionWindow(w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# label <20><><EFBFBD><EFBFBD>
|
|
|
|
|
msg = TkLabel.new($entry2_demo) {
|
|
|
|
|
font $font
|
|
|
|
|
wraplength '5i'
|
|
|
|
|
justify 'left'
|
|
|
|
|
text "3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΰۤʤ륨<EFBFBD><EFBFBD><EFBFBD>ȥ꤬<EFBFBD>ơ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD>դ<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϥݥ<EFBFBD><EFBFBD><EFBFBD><EFBF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6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>뤳<EFBFBD>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD>"
|
|
|
|
|
}
|
|
|
|
|
msg.pack('side'=>'top')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($entry2_demo) {|frame|
|
|
|
|
|
TkButton.new(frame) {
|
2004-05-01 12:09:54 -04:00
|
|
|
|
#text 'λ<><CEBB>'
|
|
|
|
|
text '<27>Ĥ<EFBFBD><C4A4><EFBFBD>'
|
2003-07-31 16:52:40 -04:00
|
|
|
|
command proc{
|
|
|
|
|
tmppath = $entry2_demo
|
|
|
|
|
$entry2_demo = nil
|
|
|
|
|
tmppath.destroy
|
|
|
|
|
}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
TkButton.new(frame) {
|
|
|
|
|
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
|
|
|
|
|
command proc{showCode 'entry2'}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($entry2_demo, 'borderwidth'=>10) {|w|
|
|
|
|
|
# entry 1
|
|
|
|
|
s1 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
|
|
|
|
|
e1 = TkEntry.new(w, 'relief'=>'sunken') {
|
|
|
|
|
xscrollcommand proc{|first,last| s1.set first,last}
|
|
|
|
|
}
|
|
|
|
|
s1.command(proc{|*args| e1.xview(*args)})
|
|
|
|
|
e1.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
s1.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# spacer
|
|
|
|
|
TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# entry 2
|
|
|
|
|
s2 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
|
|
|
|
|
e2 = TkEntry.new(w, 'relief'=>'sunken') {
|
|
|
|
|
xscrollcommand proc{|first,last| s2.set first,last}
|
|
|
|
|
}
|
|
|
|
|
s2.command(proc{|*args| e2.xview(*args)})
|
|
|
|
|
e2.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
s2.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# spacer
|
|
|
|
|
TkFrame.new(w, 'width'=>20, 'height'=>10).pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# entry 3
|
|
|
|
|
s3 = TkScrollbar.new(w, 'relief'=>'sunken', 'orient'=>'horiz')
|
|
|
|
|
e3 = TkEntry.new(w, 'relief'=>'sunken') {
|
|
|
|
|
xscrollcommand proc{|first,last| s3.set first,last}
|
|
|
|
|
}
|
|
|
|
|
s3.command(proc{|*args| e3.xview(*args)})
|
|
|
|
|
e3.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
s3.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
e1.insert(0, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
|
|
|
|
e2.insert('end', "<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD>ˤ<EFBFBD>Ĺ<EFBFBD><EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>äƤ<EFBFBD><EFBFBD>ơ<EFBFBD>")
|
|
|
|
|
e2.insert('end', "Ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڤ<EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD>Τǡ<EFBFBD>")
|
|
|
|
|
e2.insert('end', "<EFBFBD>ºݤν꽪<EFBFBD><EFBFBD><EFBFBD>ޤǸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|
|
|
|
e2.insert('end', "<EFBFBD>ʤ<EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>礦<EFBFBD><EFBFBD>")
|
|
|
|
|
|
|
|
|
|
}.pack('side'=>'top', 'fill'=>'x', 'expand'=>'yes')
|
|
|
|
|
|