2003-07-31 16:52:40 -04:00
|
|
|
|
#
|
|
|
|
|
# form widget demo (called by 'widget')
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# toplevel widget <20><>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if defined?($form_demo) && $form_demo
|
|
|
|
|
$form_demo.destroy
|
|
|
|
|
$form_demo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# demo <20>Ѥ<EFBFBD> toplevel widget <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$form_demo = TkToplevel.new {|w|
|
|
|
|
|
title("Form Demonstration")
|
|
|
|
|
iconname("form")
|
|
|
|
|
positionWindow(w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# label <20><><EFBFBD><EFBFBD>
|
|
|
|
|
msg = TkLabel.new($form_demo) {
|
|
|
|
|
font $font
|
|
|
|
|
wraplength '4i'
|
|
|
|
|
justify 'left'
|
|
|
|
|
text "<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><EFBFBD>֤ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
}
|
|
|
|
|
msg.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($form_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 = $form_demo
|
|
|
|
|
$form_demo = nil
|
|
|
|
|
tmppath.destroy
|
|
|
|
|
}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
TkButton.new(frame) {
|
|
|
|
|
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
|
|
|
|
|
command proc{showCode 'form'}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
|
|
|
|
|
|
|
|
|
|
# entry <20><><EFBFBD><EFBFBD>
|
|
|
|
|
form_data = []
|
|
|
|
|
(1..5).each{|i|
|
|
|
|
|
f = TkFrame.new($form_demo, 'bd'=>2)
|
|
|
|
|
e = TkEntry.new(f, 'relief'=>'sunken', 'width'=>40)
|
|
|
|
|
l = TkLabel.new(f)
|
|
|
|
|
e.pack('side'=>'right')
|
|
|
|
|
l.pack('side'=>'left')
|
|
|
|
|
form_data[i] = {'frame'=>f, 'entry'=>e, 'label'=>l}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
form_data[1]['label'].text('̾<><CCBE>:')
|
|
|
|
|
form_data[2]['label'].text('<27><><EFBFBD><EFBFBD>:')
|
|
|
|
|
form_data[5]['label'].text('<27><><EFBFBD><EFBFBD>:')
|
|
|
|
|
|
|
|
|
|
# pack
|
|
|
|
|
(1..5).each{|i| form_data[i]['frame'].pack('side'=>'top', 'fill'=>'x')}
|
|
|
|
|
|