summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-30 02:31:17 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-30 02:31:17 +0000
commitefe3f3f0bb356bfa99be30ad4c8abcd17419280d (patch)
tree12da524a107a50f42cc572cd8b7b2f03bfa74cbe
parentfd98eab86abfa7f7a8e72ac7cfc4b614d40d2b9a (diff)
* 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
-rw-r--r--ext/tk/sample/demos-en/widget41
-rw-r--r--ext/tk/sample/demos-jp/widget39
2 files changed, 43 insertions, 37 deletions
diff --git a/ext/tk/sample/demos-en/widget b/ext/tk/sample/demos-en/widget
index 2d390d18a3..9a0605d8b9 100644
--- a/ext/tk/sample/demos-en/widget
+++ b/ext/tk/sample/demos-en/widget
@@ -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
diff --git a/ext/tk/sample/demos-jp/widget b/ext/tk/sample/demos-jp/widget
index 45757fc819..8eb699e513 100644
--- a/ext/tk/sample/demos-jp/widget
+++ b/ext/tk/sample/demos-jp/widget
@@ -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