summaryrefslogtreecommitdiff
path: root/ext/tk/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib')
-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