mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget:
commit wrong version of code at the last commitment. sorry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd98eab86a
commit
efe3f3f0bb
2 changed files with 43 additions and 37 deletions
|
|
@ -826,10 +826,21 @@ def showCode1(demo)
|
|||
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
|
||||
}
|
||||
end
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
else
|
||||
$code_window.deiconify
|
||||
$code_window.raise
|
||||
end
|
||||
|
||||
$code_window.title("Demo code: #{file}")
|
||||
$code_window.iconname(file)
|
||||
# fid = open(file, 'r')
|
||||
|
|
@ -841,16 +852,6 @@ def showCode1(demo)
|
|||
#$code_text.set_insert('1.0')
|
||||
TkTextMarkInsert.new($code_text,'1.0')
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
$set_linenum.call($code_text)
|
||||
|
||||
fid.close
|
||||
|
|
@ -916,6 +917,17 @@ def showCode2(demo)
|
|||
$code_window.bindinfo('Return').each{|cmd, arg|
|
||||
$code_window.bind_append('Escape', cmd, arg)
|
||||
}
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
btag.bind('Configure', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
else
|
||||
$code_window.deiconify
|
||||
$code_window.raise
|
||||
|
|
@ -928,15 +940,6 @@ def showCode2(demo)
|
|||
$code_text.insert('1.0', fid.read)
|
||||
TkTextMarkInsert.new($code_text,'1.0')
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
$set_linenum.call($code_text)
|
||||
|
||||
fid.close
|
||||
|
|
|
|||
|
|
@ -864,10 +864,21 @@ def showCode1(demo)
|
|||
TkGrid.columnconfigure(f, 0, 'weight'=>1, 'minsize'=>0)
|
||||
}
|
||||
end
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
else
|
||||
$code_window.deiconify
|
||||
$code_window.raise
|
||||
end
|
||||
|
||||
$code_window.title("Demo code: #{file}")
|
||||
$code_window.iconname(file)
|
||||
# fid = open(file, 'r')
|
||||
|
|
@ -879,15 +890,6 @@ def showCode1(demo)
|
|||
#$code_text.set_insert('1.0')
|
||||
TkTextMarkInsert.new($code_text,'1.0')
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
$set_linenum.call($code_text)
|
||||
|
||||
fid.close
|
||||
|
|
@ -954,6 +956,16 @@ def showCode2(demo)
|
|||
$code_window.bindinfo('Return').each{|cmd, arg|
|
||||
$code_window.bind_append('Escape', cmd, arg)
|
||||
}
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
else
|
||||
$code_window.deiconify
|
||||
$code_window.raise
|
||||
|
|
@ -966,15 +978,6 @@ def showCode2(demo)
|
|||
$code_text.insert('1.0', fid.read)
|
||||
TkTextMarkInsert.new($code_text,'1.0')
|
||||
|
||||
btag = TkBindTag.new
|
||||
|
||||
btag.bind('Key', $set_linenum, '%W')
|
||||
btag.bind('Button', $set_linenum, '%W')
|
||||
|
||||
btags = $code_text.bindtags
|
||||
btags.insert(btags.index($code_text.class) + 1, btag)
|
||||
$code_text.bindtags = btags
|
||||
|
||||
$set_linenum.call($code_text)
|
||||
|
||||
fid.close
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue