2003-07-31 16:52:40 -04:00
|
|
|
|
#
|
|
|
|
|
# iconic button widget demo (called by 'widget')
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# toplevel widget <20><>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if defined?($icon_demo) && $icon_demo
|
|
|
|
|
$icon_demo.destroy
|
|
|
|
|
$icon_demo = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# demo <20>Ѥ<EFBFBD> toplevel widget <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$icon_demo = TkToplevel.new {|w|
|
|
|
|
|
title("Iconic Button Demonstration")
|
|
|
|
|
iconname("icon")
|
|
|
|
|
positionWindow(w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# label <20><><EFBFBD><EFBFBD>
|
|
|
|
|
msg = TkLabel.new($icon_demo) {
|
|
|
|
|
font $font
|
|
|
|
|
wraplength '5i'
|
|
|
|
|
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> 3 <20>Ĥ<EFBFBD><C4A4><EFBFBD>ˡ<EFBFBD><EFBFBD><F2BCA8A4>Ƥ<EFBFBD><C6A4>ޤ<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åפ<C3A5>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ܥ<EFBFBD><DCA5><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>"
|
|
|
|
|
}
|
|
|
|
|
msg.pack('side'=>'top')
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($icon_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 = $icon_demo
|
|
|
|
|
$icon_demo = nil
|
|
|
|
|
tmppath.destroy
|
|
|
|
|
}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
TkButton.new(frame) {
|
|
|
|
|
text '<27><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>'
|
|
|
|
|
command proc{showCode 'icon'}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
|
|
|
|
|
|
|
|
|
|
# image <20><><EFBFBD><EFBFBD>
|
|
|
|
|
flagup = \
|
2004-05-01 12:09:54 -04:00
|
|
|
|
TkBitmapImage.new('file'=>[$demo_dir,'..',
|
|
|
|
|
'images','flagup.xbm'].join(File::Separator),
|
2003-07-31 16:52:40 -04:00
|
|
|
|
'maskfile'=>\
|
2004-05-01 12:09:54 -04:00
|
|
|
|
[$demo_dir,'..','images','flagup.xbm'].join(File::Separator))
|
2003-07-31 16:52:40 -04:00
|
|
|
|
flagdown = \
|
2004-05-01 12:09:54 -04:00
|
|
|
|
TkBitmapImage.new('file'=>[$demo_dir,'..',
|
|
|
|
|
'images','flagdown.xbm'].join(File::Separator),
|
2003-07-31 16:52:40 -04:00
|
|
|
|
'maskfile'=>\
|
2004-05-01 12:09:54 -04:00
|
|
|
|
[$demo_dir,'..',
|
|
|
|
|
'images','flagdown.xbm'].join(File::Separator))
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
|
|
|
|
# <20>ѿ<EFBFBD><D1BF><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
letters = TkVariable.new
|
|
|
|
|
|
|
|
|
|
# frame <20><><EFBFBD><EFBFBD>
|
|
|
|
|
TkFrame.new($icon_demo, 'borderwidth'=>10){|w|
|
|
|
|
|
TkFrame.new(w) {|f|
|
|
|
|
|
TkRadioButton.new(f){
|
2004-05-01 12:09:54 -04:00
|
|
|
|
bitmap '@' + [$demo_dir,'..',
|
|
|
|
|
'images','letters.xbm'].join(File::Separator)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
variable letters
|
|
|
|
|
value 'full'
|
|
|
|
|
}.pack('side'=>'top', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
TkRadioButton.new(f){
|
2004-05-01 12:09:54 -04:00
|
|
|
|
bitmap '@' + [$demo_dir,'..',
|
|
|
|
|
'images','noletter.xbm'].join(File::Separator)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
variable letters
|
|
|
|
|
value 'empty'
|
|
|
|
|
}.pack('side'=>'top', 'expand'=>'yes')
|
|
|
|
|
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
|
|
|
|
|
|
|
|
|
|
TkCheckButton.new(w) {
|
|
|
|
|
image flagdown
|
|
|
|
|
selectimage flagup
|
|
|
|
|
indicatoron 0
|
|
|
|
|
selectcolor self['background']
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
|
|
|
|
|
|
|
|
|
|
TkCheckButton.new(w) {
|
2004-05-01 12:09:54 -04:00
|
|
|
|
bitmap '@' + [$demo_dir,'..',
|
|
|
|
|
'images','letters.xbm'].join(File::Separator)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
indicatoron 0
|
|
|
|
|
selectcolor 'SeaGreen1'
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
|
|
|
|
|
|
|
|
|
|
}.pack('side'=>'top')
|
|
|
|
|
|