2003-08-02 01:04:30 -04:00
|
|
|
|
#!/usr/bin/env ruby
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ( tk.rb <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD> encoding <20><><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>˻Ȥ<CBBB><C8A4><EFBFBD><EFBFBD><EFBFBD> )
|
|
|
|
|
$KCODE = 'euc'
|
|
|
|
|
|
2003-07-31 16:52:40 -04:00
|
|
|
|
# tk <20>ط<EFBFBD><D8B7>饤<EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD>
|
|
|
|
|
require 'tk'
|
2004-05-01 12:09:54 -04:00
|
|
|
|
# require 'tkafter'
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
|
|
|
|
# widget demo directory <20><><EFBFBD>֤γ<D6A4><CEB3><EFBFBD>
|
|
|
|
|
$demo_dir = File.dirname($0)
|
|
|
|
|
|
|
|
|
|
# root <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$root = TkRoot.new{title "Widget Demonstration"}
|
|
|
|
|
|
|
|
|
|
# tk <20>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>μ<EFBFBD><CEBC><EFBFBD>
|
|
|
|
|
$tk_version = Tk::TK_VERSION
|
2004-05-01 12:09:54 -04:00
|
|
|
|
$tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i}
|
|
|
|
|
$tk_patchlevel = Tk::TK_PATCHLEVEL
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
|
|
|
|
# tcl_platform <20><><EFBFBD><EFBFBD><EFBFBD>ؤΥ<D8A4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$tk_platform = TkVarAccess.new('tcl_platform')
|
|
|
|
|
|
|
|
|
|
# <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
#######
|
2004-05-01 12:09:54 -04:00
|
|
|
|
case($tk_version)
|
|
|
|
|
when /^4.*/
|
|
|
|
|
$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
|
|
|
|
|
knjfont = '-*--16-*-jisx0208.1983-0'
|
|
|
|
|
$kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
|
|
|
|
|
knjfont)
|
|
|
|
|
TkOption.add('*kanjiFont', knjfont, 'startupFile')
|
|
|
|
|
$msg_kanji_font=TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
|
|
|
|
|
'-*--24-*-jisx0208.1983-0')
|
|
|
|
|
|
|
|
|
|
#when '8.0'
|
|
|
|
|
# $font = TkFont.new('Helvetica -12')
|
|
|
|
|
# $kanji_font = TkFont.new('Helvetica -12', 'Mincho -12')
|
|
|
|
|
# TkOption.add('*kanjiFont', knjfont, 'startupFile')
|
|
|
|
|
# $msg_kanji_font=TkFont.new('Helvetica 16', 'Gothic 16 bold')
|
|
|
|
|
|
|
|
|
|
when /^8.*/
|
|
|
|
|
$font = TkFont.new('Helvetica -12')
|
|
|
|
|
$kanji_font = TkFont.new('Helvetica -12', 'Mincho -12')
|
|
|
|
|
TkOption.add('*kanjiFont', knjfont, 'startupFile')
|
|
|
|
|
$msg_kanji_font=TkFont.new('Helvetica 16', 'Gothic 16 bold')
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
|
|
|
|
|
knjfont = '-*--16-*-jisx0208.1983-0'
|
|
|
|
|
$kanji_font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
|
|
|
|
|
knjfont)
|
|
|
|
|
TkOption.add('*kanjiFont', knjfont, 'startupFile')
|
|
|
|
|
$msg_kanji_font=TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*',
|
|
|
|
|
'-*--24-*-jisx0208.1983-0')
|
|
|
|
|
end
|
2003-07-31 16:52:40 -04:00
|
|
|
|
#######
|
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
|
# <20><><EFBFBD><EFBFBD><E1A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
$image = {}
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver >= 8
|
|
|
|
|
$image['refresh'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
|
|
|
|
|
R0lGODlhEAAQAPMAAMz/zCpnKdb/1z9mPypbKBtLGy9NMPL/9Or+6+P+4j1Y
|
|
|
|
|
PwQKBP7//xMLFAYBCAEBASH5BAEAAAAALAAAAAAQABAAAwR0EAD3Gn0Vyw0e
|
|
|
|
|
++CncU7IIAezMA/nhUqSLJizvSdCEEjy2ZIV46AwDAoDHwPYGSoEiUJAAGJ6
|
|
|
|
|
EDHBNCFINW5OqABKSFk/B9lUa94IDwIFgewFMwQDQwCZQCztTgM9Sl8SOEMG
|
|
|
|
|
KSAthiaOjBMPDhQONBiXABEAOw==
|
|
|
|
|
EOD
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver >= 8
|
|
|
|
|
$image['view'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
|
|
|
|
|
R0lGODlhEAAQAPMAAMz/zP///8DAwICAgH9/fwAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
|
AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAwRIcMhJB7h3hM33
|
|
|
|
|
KFjWdQQYap1QrCaGBmrRrS4nj5b53jOgbwXBKGACoYLDIuAoHCmZyYvR1rT5
|
|
|
|
|
RMAq8LqcIYGsrjPsW1XOmFUEADs=
|
|
|
|
|
EOD
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver >= 8
|
|
|
|
|
$image['delete'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
|
|
|
|
|
R0lGODlhEAAOAKEAAIQAAO/n3v///////yH5BAEKAAIALAAAAAAQAA4AAAIm
|
|
|
|
|
lI9pAKHbIHNoVhYhTdjlJ2AWKG2g+CldmB6rxo2uybYhbS80eRQAOw==
|
|
|
|
|
EOD
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver >= 8
|
|
|
|
|
$image['print'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
|
|
|
|
|
R0lGODlhGgATAPcAACEQOTEpQjEpUkIpc0IxY0I5c0oxjEo5SlJCY1JCe1JK
|
|
|
|
|
UlpChFpCjFpGkFpSc1paa2NKc2NKnGNja2tapWtjc29KnHNanHNjc3NjrXNr
|
|
|
|
|
jHNrnHNzc3tjpXtrtXtzhICAgIRzvYSEjIZzqox7tYyEnIyMjJSEtZSEvZSM
|
|
|
|
|
lJyMtZyMvZyUlJyUrZyUvZycnKWctaWlpa2czq2lzrWtvbWtzrW1tb21xr21
|
|
|
|
|
1sa9zs693s7OztbO3tbO597W1t7W7+fe7+fn5////+/n7+/v7+/v9////wAA
|
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
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EVq+SaJajqtNrzMgsPCmoIzqmDgmWE
|
|
|
|
|
KOBuUKAAwYabYTfs4OHjY0giGyhk4MAWRI4eKyRQqPgggYUXPH4A+XBAgwoK
|
|
|
|
|
DiIsCFxjA9sFEVQQCRJCAYAFDJxiKhAxvMTonEFimrhhYinTBgWiCvxLNX3M
|
|
|
|
|
DkkpsKV5OYhjBxCMYAICAigUEAA7
|
|
|
|
|
EOD
|
|
|
|
|
end
|
|
|
|
|
|
2003-07-31 16:52:40 -04:00
|
|
|
|
# <20><><EFBFBD>˥塼<CBA5><E5A1BC><EFBFBD><EFBFBD>
|
|
|
|
|
TkMenubar.new($root,
|
|
|
|
|
[[['File', 0],
|
|
|
|
|
['About ... ', proc{aboutBox}, 0, '<F1>'],
|
|
|
|
|
'---',
|
|
|
|
|
['Quit', proc{exit}, 0, 'Meta-Q']
|
|
|
|
|
]]).pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
$root.bind('F1', proc{aboutBox})
|
2004-05-01 12:09:54 -04:00
|
|
|
|
$root.bind('Meta-q', proc{exit})
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
|
|
|
|
=begin
|
|
|
|
|
TkFrame.new($root){|frame|
|
|
|
|
|
TkMenubutton.new(frame){|button|
|
|
|
|
|
m = TkMenu.new(button) {
|
|
|
|
|
add 'command', 'label'=>'Quit', 'command'=>proc{exit}, 'underline'=>0
|
|
|
|
|
}
|
|
|
|
|
menu m
|
|
|
|
|
text 'File'
|
|
|
|
|
underline 0
|
|
|
|
|
}.pack('side'=>'left')
|
|
|
|
|
}.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
=end
|
|
|
|
|
|
|
|
|
|
# <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥܥå<DCA5><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if $tk_version =~ /^4\.[01]/
|
|
|
|
|
scr = TkScrollbar.new($root, 'orient'=>'vertical')
|
|
|
|
|
txt = TkText.new($root) {
|
|
|
|
|
#wrap 'word'
|
|
|
|
|
wrap 'char'
|
2004-05-01 12:09:54 -04:00
|
|
|
|
width 70
|
2003-07-31 16:52:40 -04:00
|
|
|
|
height 30
|
|
|
|
|
font $font
|
|
|
|
|
setgrid 'yes'
|
|
|
|
|
yscrollcommand proc{|first,last| scr.set first,last}
|
|
|
|
|
}
|
|
|
|
|
scr.command(proc{|*args| txt.yview(*args)})
|
|
|
|
|
scr.pack('side'=>'right', 'fill'=>'y')
|
|
|
|
|
txt.pack('expand'=>'yes', 'fill'=>'both')
|
|
|
|
|
else
|
|
|
|
|
textFrame = TkFrame.new($root)
|
|
|
|
|
scr = TkScrollbar.new($root, 'orient'=>'vertical',
|
|
|
|
|
'highlightthickness'=>0, 'takefocus'=>1) {
|
|
|
|
|
pack('in'=>textFrame, 'side'=>'right', 'fill'=>'y', 'padx'=>1)
|
|
|
|
|
}
|
|
|
|
|
txt = TkText.new($root) {
|
|
|
|
|
#wrap 'word'
|
|
|
|
|
wrap 'char'
|
2004-05-01 12:09:54 -04:00
|
|
|
|
width 70
|
2003-07-31 16:52:40 -04:00
|
|
|
|
height 30
|
|
|
|
|
font $font
|
|
|
|
|
setgrid 'yes'
|
|
|
|
|
highlightthickness 0
|
|
|
|
|
padx 4
|
|
|
|
|
pady 2
|
|
|
|
|
takefocus 0
|
2004-05-01 12:09:54 -04:00
|
|
|
|
bd 1
|
2003-07-31 16:52:40 -04:00
|
|
|
|
yscrollcommand proc{|first,last| scr.set first,last}
|
|
|
|
|
}
|
|
|
|
|
scr.command(proc{|*args| txt.yview(*args)})
|
|
|
|
|
# txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both', 'padx'=>1)
|
|
|
|
|
txt.pack('in'=>textFrame, 'expand'=>'yes', 'fill'=>'both')
|
|
|
|
|
# textFrame.pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>2)
|
|
|
|
|
textFrame.pack('expand'=>'yes', 'fill'=>'both')
|
|
|
|
|
|
|
|
|
|
statusBar = TkFrame.new($root) {|f|
|
|
|
|
|
$statusBarLabel = \
|
|
|
|
|
TkLabel.new(f, 'text'=>" ", 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
|
|
|
|
|
'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \
|
|
|
|
|
.pack('side'=>'left', 'padx'=>2, 'expand'=>'yes', 'fill'=>'both')
|
|
|
|
|
TkLabel.new(f, 'width'=>8, 'relief'=>'sunken', 'bd'=>1, 'anchor'=>'w',
|
|
|
|
|
'font'=>'-*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*') \
|
|
|
|
|
.pack('side'=>'left', 'padx'=>2)
|
|
|
|
|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>2)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*')
|
2004-05-01 12:09:54 -04:00
|
|
|
|
#tag_kanji_title = TkTextTag.new(txt, 'kanjifont'=>$msg_kanji_font)
|
|
|
|
|
#tag_middle = TkTextTag.new(txt, 'kanjifont'=>$kanji_font)
|
|
|
|
|
tag_kanji_title = TkTextTag.new(txt, 'font'=>$msg_kanji_font)
|
|
|
|
|
tag_middle = TkTextTag.new(txt, 'font'=>$kanji_font)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c')
|
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
|
if TkWinfo.depth($root) == 1
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
|
|
|
|
|
'underline'=>1)
|
|
|
|
|
$tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
|
|
|
|
|
'underline'=>1)
|
|
|
|
|
tag_hot = TkTextTag.new(txt, 'background'=>'black', 'foreground'=>'white')
|
|
|
|
|
else
|
|
|
|
|
tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
|
|
|
|
|
'foreground'=>'blue', 'underline'=>1)
|
|
|
|
|
$tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
|
|
|
|
|
'foreground'=>'#303080', 'underline'=>1)
|
|
|
|
|
# tag_hot = TkTextTag.new(txt, 'relief'=>'raised', 'borderwidth'=>1,
|
|
|
|
|
# 'background'=>'SeaGreen3')
|
|
|
|
|
tag_hot = TkTextTag.new(txt, 'borderwidth'=>1, 'foreground'=>'red')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#tag_demo.bind('Button-1', proc{invoke txt, txt.index('current')})
|
|
|
|
|
tag_demo.bind('ButtonRelease-1',
|
|
|
|
|
proc{|x,y|invoke txt, txt.index("@#{x},#{y}")}, '%x %y')
|
|
|
|
|
|
|
|
|
|
lastLine = TkVariable.new("")
|
|
|
|
|
newLine = TkVariable.new("")
|
|
|
|
|
tag_demo.bind('Enter', proc{|x,y|
|
|
|
|
|
lastLine.value = txt.index("@#{x},#{y} linestart")
|
|
|
|
|
tag_hot.add(lastLine.value, "#{lastLine.value} lineend")
|
|
|
|
|
showStatus txt, txt.index("@#{x},#{y}")
|
|
|
|
|
},
|
|
|
|
|
'%x %y')
|
|
|
|
|
tag_demo.bind('Leave',
|
|
|
|
|
proc{
|
|
|
|
|
tag_hot.remove('1.0','end')
|
|
|
|
|
txt.configure('cursor','xterm')
|
|
|
|
|
$statusBarLabel.configure('text'=>"")
|
|
|
|
|
})
|
|
|
|
|
tag_demo.bind('Motion', proc{|x, y|
|
|
|
|
|
newLine.value = txt.index("@#{x},#{y} linestart")
|
|
|
|
|
if newLine.value != lastLine.value
|
|
|
|
|
tag_hot.remove('1.0','end')
|
|
|
|
|
lastLine.value = newLine.value
|
|
|
|
|
if ( txt.tag_names("@#{x},#{y}").find{|t|
|
|
|
|
|
t.kind_of?(String) && t =~ /^demo-/
|
|
|
|
|
} )
|
|
|
|
|
tag_hot.add(lastLine.value,
|
|
|
|
|
"#{lastLine.value} lineend -1 chars")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
showStatus txt, txt.index("@#{x},#{y}")
|
|
|
|
|
},
|
|
|
|
|
'%x %y')
|
|
|
|
|
|
|
|
|
|
# <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
txt.insert('end', 'Ruby/Tk : Widget', tag_title)
|
|
|
|
|
#txt.insert('end', " <20>ǥ<EFBFBD><C7A5>ȥ졼<C8A5><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', " <20>ǥ<EFBFBD><C7A5>ȥ졼<C8A5><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', <<"EOT")
|
|
|
|
|
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>ץꥱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>Tk Widget <20><><EFBFBD>Ѥ<EFBFBD><D1A4>ƤɤΤ褦<CEA4>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>뤫\
|
|
|
|
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ρ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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EFBFBD><C3A5>ܥ<EFBFBD><DCA5><EFBFBD>, <20>饸<EFBFBD><E9A5B8><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD>\n",tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD>٥<EFBFBD>, <20>ܥ<EFBFBD><DCA5><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ܥ<EFBFBD><DCA5><EFBFBD>, <20>饸<EFBFBD><E9A5B8><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD>\n",
|
|
|
|
|
tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD>٥<EFBFBD> (<28>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>, <20>ӥåȥޥå<DEA5>)\n",
|
|
|
|
|
tag_demo, "demo-label")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-10-16 03:45:51 -04:00
|
|
|
|
txt.insert('end', "2. <20><><EFBFBD>٥<EFBFBD><D9A5><EFBFBD>UNICODE<44>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n", tag_demo, "demo-unicodeout")
|
2003-07-31 16:52:40 -04:00
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-10-16 03:45:51 -04:00
|
|
|
|
txt.insert('end', "3. <20>ܥ<EFBFBD><DCA5><EFBFBD> \n", tag_demo, "demo-button")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "4. <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ܥ<EFBFBD><DCA5><EFBFBD> (ʣ<><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ)\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-check")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "5. <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ܥ<EFBFBD><DCA5><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
|
|
|
|
tag_demo, "demo-check2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "6. <20>饸<EFBFBD><E9A5B8><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD> (Ǥ<>դΰ<D5A4><CEB0>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ)\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-radio")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "7. <20>饸<EFBFBD><E9A5B8><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-02 17:39:23 -04:00
|
|
|
|
tag_demo, "demo-radio2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "8. <20><><EFBFBD><EFBFBD><EFBFBD>֥饸<D6A5><E9A5B8><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
|
|
|
|
tag_demo, "demo-radio3")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "9. <20>ܥ<EFBFBD><DCA5><EFBFBD><EFBFBD>Ǻ<EFBFBD><C7BA><EFBFBD><EFBFBD>줿15-<2D>ѥ<EFBFBD><D1A5>륲<EFBFBD><EBA5B2><EFBFBD><EFBFBD>\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-puzzle")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "10. <20>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܥ<EFBFBD><DCA5><EFBFBD>\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-icon")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "11. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĤΥ<C4A4><CEA5>٥<EFBFBD>\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-image1")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "12. <20><><EFBFBD><EFBFBD><EFBFBD>뤿<F2B8ABA4><EBA4BF><EFBFBD>δ<EFBFBD>ñ<EFBFBD>ʥ桼<CAA5><E6A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A5BFA1>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-image2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "13. <20><><EFBFBD><EFBFBD><EFBFBD>뤿<F2B8ABA4><EBA4BF><EFBFBD>δ<EFBFBD>ñ<EFBFBD>ʥ桼<CAA5><E6A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A5BFA1>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-03 04:17:41 -04:00
|
|
|
|
tag_demo, "demo-image3")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "14. <20><><EFBFBD>٥<EFBFBD><D9A5>դ<EFBFBD><D5A4>ե졼<D5A5><ECA1BC> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-02 05:58:13 -04:00
|
|
|
|
tag_demo, "demo-labelframe")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22>ꥹ<EFBFBD>ȥܥå<DCA5><C3A5><EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22>ꥹ<EFBFBD>ȥܥå<DCA5><C3A5><EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><>ƻ<EFBFBD>ܸ<EFBFBD>.\n", tag_demo, "demo-states")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20><>: <20><><EFBFBD>ץꥱ<D7A5><EAA5B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD>\n",
|
|
|
|
|
"#{tag_demo.id} demo-colors")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "3. <20>ʸ<EFBFBD><CAB8><EFBFBD>\n", tag_demo, "demo-sayings")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
2003-08-02 05:58:13 -04:00
|
|
|
|
#txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>ȥ<EFBFBD><C8A5>ԥ<EFBFBD><D4A5>ܥå<DCA5><C3A5><EFBFBD>\n", tag_middle)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1>ʤ<EFBFBD>\n", tag_demo, "demo-entry1")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-entry2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-10-14 15:36:09 -04:00
|
|
|
|
txt.insert('end', "3. ǧ<>ڽ<EFBFBD><DABD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5>ܥå<DCA5><C3A5><EFBFBD><EFBFBD>ȥѥ<C8A5><D1A5><EFBFBD>ɥե<C9A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
|
|
|
|
tag_demo, "demo-entry3")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "4. <20><><EFBFBD>ԥ<EFBFBD><D4A5>ܥå<DCA5><C3A5><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-02 05:58:13 -04:00
|
|
|
|
tag_demo, "demo-spin")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-10-14 15:36:09 -04:00
|
|
|
|
txt.insert('end', "5. <20><>ñ<EFBFBD>ʥե<CAA5><D5A5><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-form")
|
2003-07-31 16:52:40 -04:00
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD><EFBFBD>Ū<EFBFBD>ʥƥ<CAA5><C6A5><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-text")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n", tag_demo, "demo-style")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "3. <20>ϥ<EFBFBD><CFA5>ѡ<EFBFBD><D1A1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD>).\n",
|
|
|
|
|
tag_demo, "demo-bind")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "4. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>\n",
|
|
|
|
|
tag_demo, "demo-twind")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "5. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
|
|
|
|
tag_demo, "demo-twind2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "6. <20><><EFBFBD><EFBFBD>\n", tag_demo, "demo-search")
|
2003-07-31 16:52:40 -04:00
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5>η<EFBFBD>\n", tag_demo, "demo-items")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. 2 <20><><EFBFBD><EFBFBD><EFBFBD>Υץ<CEA5><D7A5>å<EFBFBD>\n", tag_demo, "demo-plot")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "3. <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-ctext")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "4. <20><><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD>\n", tag_demo, "demo-arrow")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "5. <20>롼<EFBFBD>顼\n", tag_demo, "demo-ruler")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "6. <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>ץ<EFBFBD><D7A5><EFBFBD>\n", tag_demo, "demo-floor")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2004-05-01 12:09:54 -04:00
|
|
|
|
txt.insert('end', "7. <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>ץ<EFBFBD><D7A5><EFBFBD> (<28>ۤʤ륭<CAA4><EBA5AD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)\n", tag_demo, "demo-floor2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "8. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ʥ<EFBFBD><CAA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD>\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-cscroll")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><>ľ\n", tag_demo.id, "demo-vscale")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20><>ʿ\n", tag_demo.id, "demo-hscale")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
2003-08-02 05:58:13 -04:00
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
txt.insert('end', "<22>ڥ<EFBFBD><DAA5><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-08-02 17:39:23 -04:00
|
|
|
|
txt.insert('end', "1. <20><>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-02 05:58:13 -04:00
|
|
|
|
tag_demo.id, "demo-paned1")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-08-02 17:39:23 -04:00
|
|
|
|
txt.insert('end', "2. <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
2003-08-02 05:58:13 -04:00
|
|
|
|
tag_demo.id, "demo-paned2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
2003-07-31 16:52:40 -04:00
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22><><EFBFBD>˥塼\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD>˥塼\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD>˥塼<CBA5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD>\n",
|
|
|
|
|
tag_demo, "demo-menu")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20><><EFBFBD>˥塼<CBA5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD> (Tk8.x <20><><EFBFBD><EFBFBD>)\n",
|
|
|
|
|
tag_demo, "demo-menu8x")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
2003-08-02 17:39:23 -04:00
|
|
|
|
txt.insert('end', "3. <20><> (<28><>ǽ<EFBFBD><C7BD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Tk<54><6B>ɬ<EFBFBD><C9AC>)\n",
|
|
|
|
|
tag_demo, "demo-menu84")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "4. <20><><EFBFBD>˥塼<CBA5>ܥ<EFBFBD><DCA5><EFBFBD> (Tk8.x <20><><EFBFBD><EFBFBD>)\n",
|
2003-07-31 16:52:40 -04:00
|
|
|
|
tag_demo, "demo-menubu")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD>\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD>\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20><><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܥå<DCA5><C3A5><EFBFBD>\n", tag_demo, "demo-msgbox")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-filebox")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n", tag_demo, "demo-clrpick")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.insert('end', "\n")
|
|
|
|
|
#txt.insert('end', "<22><><EFBFBD><EFBFBD>¾\n", tag_middle)
|
|
|
|
|
txt.insert('end', "<22><><EFBFBD><EFBFBD>¾\n", tag_kanji_title)
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "1. <20>Ȥ߹<C8A4><DFB9>ߤΥӥåȥޥå<DEA5>\n", tag_demo, "demo-bitmap")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "2. <20>⡼<EFBFBD><E2A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륰<EFBFBD><EBA5B0><EFBFBD><EFBFBD>)\n",
|
|
|
|
|
tag_demo, "demo-dialog1")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
txt.insert('end', "3. <20>⡼<EFBFBD><E2A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х륰<D0A5><EBA5B0><EFBFBD><EFBFBD>)\n",
|
|
|
|
|
tag_demo, "demo-dialog2")
|
|
|
|
|
txt.insert('end', " \n ", tag_demospace)
|
|
|
|
|
|
|
|
|
|
txt.state('disabled')
|
|
|
|
|
scr.focus
|
|
|
|
|
|
|
|
|
|
################################
|
|
|
|
|
# method <20><><EFBFBD><EFBFBD>
|
|
|
|
|
################################
|
|
|
|
|
def positionWindow(w)
|
|
|
|
|
w.geometry('+300+300')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤȡ<C8A4><C8A1>ѿ<EFBFBD>̾<EFBFBD><CCBE> TkVariable <20>Ȥ<EFBFBD><C8A4><EFBFBD>(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD>¤Ӥ<C2A4><D3A4>Ϥ<EFBFBD>
|
|
|
|
|
$showVarsWin = {}
|
2004-05-01 12:09:54 -04:00
|
|
|
|
def showVars1(parent, *args)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
if $showVarsWin[parent.path]
|
|
|
|
|
begin
|
|
|
|
|
$showVarsWin[parent.path].destroy
|
|
|
|
|
rescue
|
|
|
|
|
end
|
|
|
|
|
end
|
2004-05-01 12:09:54 -04:00
|
|
|
|
top = TkToplevel.new(parent) {|w|
|
2003-07-31 16:52:40 -04:00
|
|
|
|
title "Variable values"
|
|
|
|
|
TkLabel.new(w) {
|
|
|
|
|
text "<22>ѿ<EFBFBD><D1BF><EFBFBD>:"
|
|
|
|
|
width 20
|
|
|
|
|
anchor 'center'
|
|
|
|
|
font '-Adobe-helvetica-medium-r-normal--*-180-*-*-*-*-*-*'
|
|
|
|
|
}.pack('side'=>'top', 'fill'=>'x')
|
|
|
|
|
len = 1
|
|
|
|
|
args.each{|vnam,vbody|
|
|
|
|
|
len = vnam.to_s.length if vnam.to_s.length > len
|
|
|
|
|
}
|
|
|
|
|
args.each{|vnam,vbody|
|
|
|
|
|
TkFrame.new(w){|f|
|
|
|
|
|
#TkLabel.new(f, 'text'=>"#{vnam}: ").pack('side'=>'left')
|
|
|
|
|
TkLabel.new(f, 'text'=>"#{vnam}: ",'width'=>len+2).pack('side'=>'left')
|
|
|
|
|
TkLabel.new(f, 'textvariable'=>vbody, 'anchor'=>'w')\
|
|
|
|
|
.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'x')
|
|
|
|
|
}.pack('side'=>'top', 'anchor'=>'w', 'fill'=>'x')
|
|
|
|
|
}
|
|
|
|
|
TkButton.new(w) {
|
|
|
|
|
text "λ<><CEBB>"
|
|
|
|
|
command proc{w.destroy}
|
|
|
|
|
}.pack('side'=>'bottom', 'pady'=>2)
|
|
|
|
|
}
|
2004-05-01 12:09:54 -04:00
|
|
|
|
$showVarsWin[parent.path] = top
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def showVars2(parent, *args)
|
|
|
|
|
if $showVarsWin[parent.path]
|
|
|
|
|
begin
|
|
|
|
|
$showVarsWin[parent.path].destroy
|
|
|
|
|
rescue
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
$showVarsWin[parent.path] = TkToplevel.new(parent) {|w|
|
|
|
|
|
title "Variable values"
|
|
|
|
|
|
|
|
|
|
TkLabelFrame.new(w, :text=>"<22>ѿ<EFBFBD><D1BF><EFBFBD>:",
|
|
|
|
|
:font=>{:family=>'Helvetica', :size=>14}){|f|
|
|
|
|
|
args.each{|vnam,vbody|
|
|
|
|
|
TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
|
|
|
|
|
TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'),
|
|
|
|
|
:padx=>2, :pady=>2, :sticky=>'w')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f.grid(:sticky=>'news', :padx=>4)
|
|
|
|
|
f.grid_columnconfig(1, :weight=>1)
|
|
|
|
|
f.grid_rowconfig(100, :weight=>1)
|
|
|
|
|
}
|
|
|
|
|
TkButton.new(w, :text=>"λ<><CEBB>", :width=>8, :default=>:active,
|
|
|
|
|
:command=>proc{w.destroy}){|b|
|
|
|
|
|
w.bind('Return', proc{b.invoke})
|
|
|
|
|
w.bind('Escape', proc{b.invoke})
|
|
|
|
|
|
|
|
|
|
b.grid(:sticky=>'e', :padx=>4, :pady=>[6, 4])
|
|
|
|
|
}
|
|
|
|
|
w.grid_columnconfig(0, :weight=>1)
|
|
|
|
|
w.grid_rowconfig(0, :weight=>1)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver < 8
|
|
|
|
|
alias showVars showVars1
|
|
|
|
|
elsif $tk_major_ver == 8 && $tk_minor_ver < 4
|
|
|
|
|
alias showVars showVars1
|
|
|
|
|
else # ver >= 8.4
|
|
|
|
|
alias showVars showVars2
|
2003-07-31 16:52:40 -04:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ⱦ<EFBFBD><C8BE>Ǥ<EFBFBD> click <20><><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD>ư<EFBFBD><C6B0>
|
|
|
|
|
def invoke (txt, index)
|
|
|
|
|
tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/}
|
|
|
|
|
return unless tag
|
|
|
|
|
cursor = txt.cget('cursor')
|
|
|
|
|
txt.cursor('watch')
|
|
|
|
|
Tk.update
|
|
|
|
|
# eval `cat #{tag[5..-1]}.rb`
|
2004-05-01 12:09:54 -04:00
|
|
|
|
# eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
|
|
|
|
|
eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
|
2003-07-31 16:52:40 -04:00
|
|
|
|
Tk.update
|
|
|
|
|
# txt.cursor('xterm')
|
|
|
|
|
txt.cursor(cursor)
|
|
|
|
|
|
|
|
|
|
$tag_visited.add("#{index} linestart +1 chars", "#{index} lineend +1 chars")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD>
|
|
|
|
|
def showStatus (txt, index)
|
|
|
|
|
tag = txt.tag_names(index).find{|t| t.kind_of?(String) && t =~ /^demo-/}
|
|
|
|
|
cursor = txt.cget('cursor')
|
|
|
|
|
unless tag
|
|
|
|
|
$statusBarLabel.configure('text', " ")
|
|
|
|
|
newcursor = 'xterm'
|
|
|
|
|
else
|
|
|
|
|
demoname = tag[5..-1]
|
|
|
|
|
$statusBarLabel.configure('text',
|
|
|
|
|
"<22><><EFBFBD><EFBFBD><EFBFBD>ץ<EFBFBD><D7A5>ץ<EFBFBD><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"#{demoname}\" <20>μ¹<CEBC> ")
|
|
|
|
|
newcursor = 'hand2'
|
|
|
|
|
end
|
|
|
|
|
txt.configure('cursor'=>newcursor) if cursor != newcursor
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD>ɽ<EFBFBD><C9BD>
|
2004-05-01 12:09:54 -04:00
|
|
|
|
def showCode1(demo)
|
2003-07-31 16:52:40 -04:00
|
|
|
|
file = "#{demo}.rb"
|
|
|
|
|
$code_window = nil unless defined? $code_window
|
2004-05-01 12:09:54 -04:00
|
|
|
|
if $code_window == nil || TkWinfo.exist?($code_window) == false
|
2003-07-31 16:52:40 -04:00
|
|
|
|
$code_window = TkToplevel.new(nil)
|
|
|
|
|
f = TkFrame.new($code_window)
|
|
|
|
|
TkButton.new(f) {
|
2004-05-01 12:09:54 -04:00
|
|
|
|
#text "λ<><CEBB>"
|
|
|
|
|
text "<22>Ĥ<EFBFBD><C4A4><EFBFBD>"
|
2003-07-31 16:52:40 -04:00
|
|
|
|
command proc{
|
|
|
|
|
$code_window.destroy
|
|
|
|
|
$code_window = nil
|
|
|
|
|
}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2)
|
|
|
|
|
TkButton.new(f) {
|
|
|
|
|
text "<22>Ƽ¹<C6BC>"
|
|
|
|
|
command proc{eval($code_text.get('1.0','end'))}
|
|
|
|
|
}.pack('side'=>'left', 'expand'=>'yes', 'pady'=>2)
|
|
|
|
|
# f.pack('side'=>'bottom', 'expand'=>'yes', 'fill'=>'x')
|
|
|
|
|
f.pack('side'=>'bottom', 'fill'=>'x')
|
|
|
|
|
|
|
|
|
|
if $tk_version =~ /^4\.[01]/
|
|
|
|
|
s = TkScrollbar.new($code_window, 'orient'=>'vertical')
|
|
|
|
|
$code_text = TkText.new($code_window) {
|
|
|
|
|
height 40
|
|
|
|
|
setgrid 'yes'
|
|
|
|
|
yscrollcommand proc{|first,last| s.set first,last}
|
|
|
|
|
}
|
|
|
|
|
s.command(proc{|*args| $code_text.yview(*args)})
|
|
|
|
|
s.pack('side'=>'right', 'fill'=>'y')
|
|
|
|
|
$code_text.pack('side'=>'left', 'expand'=>'yes', 'fill'=>'both')
|
|
|
|
|
else
|
|
|
|
|
TkFrame.new($code_window) {|f|
|
|
|
|
|
pack('expand'=>'yes', 'fill'=>'both', 'padx'=>1, 'pady'=>1)
|
|
|
|
|
|
|
|
|
|
hs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
|
|
|
|
|
'orient'=>'horizontal')
|
|
|
|
|
vs = TkScrollbar.new($code_window, 'highlightthickness'=>0,
|
|
|
|
|
'orient'=>'vertical')
|
|
|
|
|
$code_text = TkText.new($code_window) {|t|
|
|
|
|
|
height 40
|
|
|
|
|
#wrap 'word'
|
|
|
|
|
wrap 'char'
|
|
|
|
|
xscrollcommand proc{|first,last| hs.set first,last}
|
|
|
|
|
yscrollcommand proc{|first,last| vs.set first,last}
|
|
|
|
|
setgrid 'yes'
|
|
|
|
|
highlightthickness 0
|
|
|
|
|
pady 2
|
|
|
|
|
padx 3
|
|
|
|
|
hs.command(proc{|*args| $code_text.xview(*args)})
|
|
|
|
|
vs.command(proc{|*args| $code_text.yview(*args)})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$code_text.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
|
|
|
|
|
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
|
|
|
|
vs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
|
|
|
|
|
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
|
|
|
|
# xs.grid('in'=>f, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
|
|
|
|
|
# 'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
|
|
|
|
TkGrid.rowconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
|
|
|
|
|
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
$code_window.deiconify
|
|
|
|
|
$code_window.raise
|
|
|
|
|
end
|
|
|
|
|
$code_window.title("Demo code: #{file}")
|
|
|
|
|
$code_window.iconname(file)
|
|
|
|
|
# fid = open(file, 'r')
|
|
|
|
|
fid = open([$demo_dir, file].join(File::Separator), 'r')
|
|
|
|
|
$code_text.delete('1.0', 'end')
|
|
|
|
|
#$code_text.insert('1.0', `cat #{file}`)
|
|
|
|
|
$code_text.insert('1.0', fid.read)
|
|
|
|
|
#$code_mark = TkTextMark.new($code_text, '1.0')
|
|
|
|
|
#$code_text.set_insert('1.0')
|
|
|
|
|
TkTextMarkInsert.new($code_text,'1.0')
|
|
|
|
|
fid.close
|
|
|
|
|
end
|
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
|
def showCode2(demo)
|
|
|
|
|
file = "#{demo}.rb"
|
|
|
|
|
$code_window = nil unless defined? $code_window
|
|
|
|
|
if $code_window == nil || TkWinfo.exist?($code_window) == false
|
|
|
|
|
$code_window = TkToplevel.new(nil)
|
|
|
|
|
tf = TkFrame.new($code_window)
|
|
|
|
|
$code_text = TkText.new(tf, :font=>'Courier 10', :height=>30,
|
|
|
|
|
:wrap=>'word', :bd=>1, :setgrid=>true,
|
|
|
|
|
:highlightthickness=>0, :pady=>2, :padx=>3)
|
|
|
|
|
xscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
|
|
|
|
|
yscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
|
|
|
|
|
TkGrid($code_text, yscr, :sticky=>'news')
|
|
|
|
|
#TkGrid(xscr)
|
|
|
|
|
tf.grid_rowconfigure(0, :weight=>1)
|
|
|
|
|
tf.grid_columnconfigure(0, :weight=>1)
|
|
|
|
|
|
|
|
|
|
bf = TkFrame.new($code_window)
|
|
|
|
|
|
|
|
|
|
#b_dis = TkButton.new(bf, :text=>'λ<><CEBB>', :default=>:active,
|
|
|
|
|
b_dis = TkButton.new(bf, :text=>'<27>Ĥ<EFBFBD><C4A4><EFBFBD>', :default=>:active,
|
|
|
|
|
:command=>proc{
|
|
|
|
|
$code_window.destroy
|
|
|
|
|
$code_window = nil
|
|
|
|
|
},
|
|
|
|
|
:image=>$image['delete'], :compound=>:left)
|
|
|
|
|
b_prn = TkButton.new(bf, :text=>'<27><><EFBFBD><EFBFBD>',
|
|
|
|
|
:command=>proc{printCode($code_text, file)},
|
|
|
|
|
:image=>$image['print'], :compound=>:left)
|
|
|
|
|
b_run = TkButton.new(bf, :text=>'<27>Ƽ¹<C6BC>',
|
|
|
|
|
:command=>proc{eval($code_text.get('1.0','end'))},
|
|
|
|
|
:image=>$image['refresh'], :compound=>:left)
|
|
|
|
|
|
|
|
|
|
TkGrid('x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
|
|
|
|
|
bf.grid_columnconfigure(0, :weight=>1)
|
|
|
|
|
|
|
|
|
|
TkGrid(tf, :sticky=>'news')
|
|
|
|
|
TkGrid(bf, :sticky=>'ew')
|
|
|
|
|
$code_window.grid_columnconfigure(0, :weight=>1)
|
|
|
|
|
$code_window.grid_rowconfigure(0, :weight=>1)
|
|
|
|
|
|
|
|
|
|
$code_window.bind('Return', proc{|win|
|
|
|
|
|
b_dis.invoke unless win.kind_of?(TkText)
|
|
|
|
|
}, '%W')
|
|
|
|
|
$code_window.bindinfo('Return').each{|cmd, arg|
|
|
|
|
|
$code_window.bind_append('Escape', cmd, arg)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
$code_window.deiconify
|
|
|
|
|
$code_window.raise
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
$code_window.title("Demo code: #{file}")
|
|
|
|
|
$code_window.iconname(file)
|
|
|
|
|
fid = open([$demo_dir, file].join(File::Separator), 'r')
|
|
|
|
|
$code_text.delete('1.0', 'end')
|
|
|
|
|
$code_text.insert('1.0', fid.read)
|
|
|
|
|
TkTextMarkInsert.new($code_text,'1.0')
|
|
|
|
|
fid.close
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if $tk_major_ver < 8
|
|
|
|
|
alias showCode showCode1
|
|
|
|
|
elsif $tk_major_ver == 8 && $tk_minor_ver < 4
|
|
|
|
|
alias showCode showCode1
|
|
|
|
|
else # ver >= 8.4
|
|
|
|
|
alias showCode showCode2
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# printCode --
|
|
|
|
|
# Prints the source code currently displayed in the See Code dialog.
|
|
|
|
|
# Much thanks to Arjen Markus for this.
|
|
|
|
|
#
|
|
|
|
|
# Arguments:
|
|
|
|
|
# txt - Name of text widget containing code to print
|
|
|
|
|
# file - Name of the original file (implicitly for title)
|
|
|
|
|
|
|
|
|
|
def printCode(txt, file)
|
|
|
|
|
code = txt.get('1.0', 'end - 1c')
|
|
|
|
|
dir = '.'
|
|
|
|
|
dir = ENV['HOME'] if ENV['HOME']
|
|
|
|
|
dir = ENV['TMP'] if ENV['TMP']
|
|
|
|
|
dir = ENV['TEMP'] if ENV['TEMP']
|
|
|
|
|
|
|
|
|
|
fname = [dir, 'tkdemo-' + file].join(File::Separator)
|
|
|
|
|
open(fname, 'w'){|fid| fid.print(code)}
|
|
|
|
|
begin
|
|
|
|
|
case Tk::TCL_PLATFORM('platform')
|
|
|
|
|
when 'unix'
|
|
|
|
|
msg = `lp -c #{fname}`
|
|
|
|
|
unless $?.exitstatus == 0
|
|
|
|
|
Tk.messageBox(:title=>'Print spooling failure',
|
|
|
|
|
:message=>'<27><><EFBFBD>顼<EFBFBD><E9A1BC>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>' +
|
|
|
|
|
'<27><><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȻפ<C8BB><D7A4><EFBFBD><EFBFBD>ޤ<EFBFBD> : ' + msg)
|
|
|
|
|
end
|
|
|
|
|
when 'windows'
|
|
|
|
|
begin
|
|
|
|
|
printTextWin32(fname)
|
|
|
|
|
rescue => e
|
|
|
|
|
Tk.messageBox(:title=>'Print spooling failure',
|
|
|
|
|
:message=>'<27><><EFBFBD>顼<EFBFBD><E9A1BC>ȯ<EFBFBD><C8AF><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>' +
|
|
|
|
|
'<27><><EFBFBD><EFBFBD><EFBFBD>˼<EFBFBD><CBBC>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȻפ<C8BB><D7A4><EFBFBD><EFBFBD>ޤ<EFBFBD> : ' +
|
|
|
|
|
e.message)
|
|
|
|
|
end
|
|
|
|
|
when 'macintosh'
|
|
|
|
|
Tk.messageBox(:title=>'Operation not Implemented',
|
|
|
|
|
:message=>'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>Ϥޤ<CFA4><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>')
|
|
|
|
|
else
|
|
|
|
|
Tk.messageBox(:title=>'Operation not Implemented',
|
|
|
|
|
:message=>'<27><><EFBFBD>Ф<EFBFBD><D0A4>줿<EFBFBD>Ķ<EFBFBD> ' +
|
|
|
|
|
Tk::TCL_PLATFORM('platform') +
|
|
|
|
|
' <20><>̤<EFBFBD>ΤδĶ<CEB4><C4B6>Ǥ<EFBFBD><C7A4>뤿<EFBFBD>ᡤ' +
|
|
|
|
|
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>: ')
|
|
|
|
|
end
|
|
|
|
|
ensure
|
|
|
|
|
File.delete(fname)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# printTextWin32 --
|
|
|
|
|
# Print a file under Windows
|
|
|
|
|
#
|
|
|
|
|
# Arguments:
|
|
|
|
|
# filename - Name of the file
|
|
|
|
|
#
|
|
|
|
|
def printTextWin32(fname)
|
|
|
|
|
require 'win32/registry'
|
|
|
|
|
begin
|
|
|
|
|
app = Win32::Registry::HKEY_CLASSES_ROOT['.txt']
|
|
|
|
|
pcmd = nil
|
|
|
|
|
Win32::Registry::HKEY_CLASSES_ROOT.open("#{app}\\shell\\print"){|reg|
|
|
|
|
|
pcmd = reg['command']
|
|
|
|
|
}
|
|
|
|
|
rescue
|
|
|
|
|
app = Tk.tk_call('auto_execok', 'notepad.exe')
|
|
|
|
|
pcmd = "#{app} /p %1"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
pcmd.gsub!('%1', fname)
|
|
|
|
|
puts pcmd
|
|
|
|
|
cmd = Tk.tk_call('auto_execok', 'start') + ' /min ' + pcmd
|
|
|
|
|
|
|
|
|
|
msg = `#{cmd}`
|
|
|
|
|
unless $?.exitstatus == 0
|
|
|
|
|
fail RuntimeError, msg
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2003-07-31 16:52:40 -04:00
|
|
|
|
# aboutBox
|
|
|
|
|
#
|
|
|
|
|
# Pops up a message box with an "about" message
|
|
|
|
|
#
|
|
|
|
|
def aboutBox
|
|
|
|
|
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
|
2004-05-01 12:09:54 -04:00
|
|
|
|
'message'=>"Ruby/Tk <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȥǥ<C8A5> Ver.1.4.3-jp\n\n" +
|
|
|
|
|
"based on demos of Tk8.1 -- 8.5 " +
|
|
|
|
|
"( Copyright:: " +
|
|
|
|
|
"(c) 1996-1997 Sun Microsystems, Inc. / " +
|
|
|
|
|
"(c) 1997-2000 Ajuba Solutions, Inc. / " +
|
|
|
|
|
"(c) 2001-2003 Donal K. Fellows )\n\n" +
|
|
|
|
|
"Your Ruby & Tk Version ::\n" +
|
|
|
|
|
"Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
####################################
|
|
|
|
|
# <20><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD><C7BB>ꤵ<EFBFBD>줿<EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD>
|
|
|
|
|
no_launcher = false
|
|
|
|
|
if ARGV[0] == '-n'
|
|
|
|
|
ARGV.shift
|
|
|
|
|
no_launcher = true if ARGV.size > 0
|
|
|
|
|
end
|
|
|
|
|
ARGV.each{|cmd|
|
|
|
|
|
if cmd =~ /(.*).rb/
|
|
|
|
|
cmd = $1
|
|
|
|
|
end
|
|
|
|
|
eval IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join
|
|
|
|
|
}
|
|
|
|
|
if no_launcher
|
|
|
|
|
$root.withdraw # hide root window
|
|
|
|
|
Thread.start{
|
|
|
|
|
loop do
|
|
|
|
|
count = 0
|
|
|
|
|
$root.winfo_children.each{|w|
|
|
|
|
|
count += 1 if w.kind_of?(TkToplevel)
|
|
|
|
|
}
|
|
|
|
|
$root.destroy if count == 0
|
|
|
|
|
end
|
|
|
|
|
}
|
2003-07-31 16:52:40 -04:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
################################
|
|
|
|
|
# <20><><EFBFBD>٥<EFBFBD><D9A5><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Tk.mainloop
|