summaryrefslogtreecommitdiff
path: root/ext/tk
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-24 04:24:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-06-24 04:24:09 +0000
commit031d2e84df58ed54948671931544c41cf32da1ca (patch)
tree1118362b178f55bf14d142752b8d61976191b991 /ext/tk
parent37bcc42c983987ec504efd9556f0cb884f0b424d (diff)
990624
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
-rw-r--r--ext/tk/lib/tk.rb13
-rw-r--r--ext/tk/lib/tkfont.rb14
-rw-r--r--ext/tk/lib/tktext.rb2
3 files changed, 20 insertions, 9 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index dae2aeb0d8..1a1c6557d4 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -2005,11 +2005,9 @@ class TkLabel<TkWindow
end
class TkButton<TkLabel
- WidgetClassName = 'Button'.freeze
- TkClassBind::WidgetClassNameTBL[WidgetClassName] = self
-# def TkButton.to_eval
- def self.to_eval
- WidgetClassName
+ TkClassBind::WidgetClassNameTBL['Button'] = self
+ def TkButton.to_eval
+ 'Button'
end
def create_self
tk_call 'button', @path
@@ -2023,10 +2021,9 @@ class TkButton<TkLabel
end
class TkRadioButton<TkButton
- WidgetClassName = 'Radiobutton'.freeze
- TkClassBind::WidgetClassNameTBL[WidgetClassName] = self
+ TkClassBind::WidgetClassNameTBL['Radiobutton'] = self
def TkRadioButton.to_eval
- WidgetClassName
+ 'Radiobutton'
end
def create_self
tk_call 'radiobutton', @path
diff --git a/ext/tk/lib/tkfont.rb b/ext/tk/lib/tkfont.rb
index 1526f68d88..c680d166e7 100644
--- a/ext/tk/lib/tkfont.rb
+++ b/ext/tk/lib/tkfont.rb
@@ -817,6 +817,7 @@ class TkFont
#if JAPANIZED_TK
if @kanjifont != ""
configure_core(@kanjifont, slot, value)
+ configure('size'=>configinfo('size')) # to reflect new configuration
else
#""
configure(slot, value)
@@ -841,10 +842,12 @@ class TkFont
def latin_replace(ltn)
latin_replace_core(ltn)
+ reset_pointadjust
end
def kanji_replace(knj)
kanji_replace_core(knj)
+ reset_pointadjust
end
def measure(text)
@@ -891,6 +894,17 @@ class TkFont
end
end
+ def reset_pointadjust
+ begin
+ if /^8\.*/ === Tk::TK_VERSION && JAPANIZED_TK
+ configure('pointadjust' => latin_actual.assoc('size')[1].to_f /
+ kanji_actual.assoc('size')[1].to_f )
+ end
+ rescue
+ end
+ self
+ end
+
###################################
# public alias
###################################
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
index 8e07cf4347..324af90f85 100644
--- a/ext/tk/lib/tktext.rb
+++ b/ext/tk/lib/tktext.rb
@@ -429,7 +429,7 @@ class TkTextTag<TkObject
include TkTreatTagFont
$tk_text_tag = 'tag0000'
- def initialize(parent, keys=nil)
+ def initialize(parent, *args)
if not parent.kind_of?(TkText)
fail format("%s need to be TkText", parent.inspect)
end