diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 22:16:33 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 22:16:33 +0000 |
commit | a3d7c3b80984d58d849eb774f43364aadf077e2a (patch) | |
tree | c9552a229e194096f8ef09fe4edf551b66bfd479 /ext/tk/lib/tk | |
parent | 2e4c479a6bef19468d430b7291d911581ae13dfe (diff) |
* ext/tcltklib/extconf.rb: improbe messages [ruby-core:06325].
* ext/tk/lib/tk.rb, ext/tk/lib/tk/canvas.rb, ext/tk/lib/tk/entry.rb,
ext/tk/lib/tk/frame.rb, ext/tk/lib/tk/image.rb,
ext/tk/lib/tk/itemconfig.rb, ext/tk/lib/tk/labelframe.rb,
ext/tk/lib/tk/listbox.rb, ext/tk/lib/tk/menu.rb,
ext/tk/lib/tk/radiobutton.rb, ext/tk/lib/tk/scale.rb,
ext/tk/lib/tk/spinbox.rb, ext/tk/lib/tk/text.rb,
ext/tk/lib/tk/toplevel.rb: improve conversion of option values.
* ext/tk/lib/tkextlib/*: ditto.
* ext/tk/lib/tkextlib/*: update to support ActiveTcl8.4.11.2.
* ext/tk/lib/tkextlib/trofs/*: support Trofs 0.4.3.
* ext/tk/lib/tkextlib/tile/*: support Tile 0.7.2.
* ext/tk/lib/tkextlib/vu/*: support vu 2.3.0.
* ext/tk/lib/tkextlib/tcllib/*: support Tcllib 1.8 (Tklib 0.3).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk')
-rw-r--r-- | ext/tk/lib/tk/canvas.rb | 24 | ||||
-rw-r--r-- | ext/tk/lib/tk/entry.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/frame.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/image.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/itemconfig.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tk/labelframe.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/listbox.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/menu.rb | 26 | ||||
-rw-r--r-- | ext/tk/lib/tk/radiobutton.rb | 10 | ||||
-rw-r--r-- | ext/tk/lib/tk/scale.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/spinbox.rb | 15 | ||||
-rw-r--r-- | ext/tk/lib/tk/text.rb | 5 | ||||
-rw-r--r-- | ext/tk/lib/tk/toplevel.rb | 15 |
13 files changed, 133 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb index 97bc6cc14a..94b43ebc39 100644 --- a/ext/tk/lib/tk/canvas.rb +++ b/ext/tk/lib/tk/canvas.rb @@ -11,11 +11,25 @@ require 'tk/scrollable' module TkCanvasItemConfig include TkItemConfigMethod + def __item_strval_optkeys(id) + # maybe need to override + super(id) + [ + 'fill', 'activefill', 'disabledfill', + 'outline', 'activeoutline', 'disabledoutline' + ] + end + private :__item_strval_optkeys + def __item_methodcall_optkeys(id) {'coords'=>'coords'} end private :__item_methodcall_optkeys + def __item_val2ruby_optkeys(id) # { key=>proc, ... } + super(id).update('window'=>proc{|i, v| window(v)}) + end + private :__val2ruby_optkeys + def __item_pathname(tagOrId) if tagOrId.kind_of?(TkcItem) || tagOrId.kind_of?(TkcTag) self.path + ';' + tagOrId.id.to_s @@ -47,6 +61,16 @@ class TkCanvas<TkWindow #end #private :create_self + def __numval_optkeys + super() + ['closeenough'] + end + private :__numval_optkeys + + def __boolval_optkeys + super() + ['confine'] + end + private :__boolval_optkeys + def tagid(tag) if tag.kind_of?(TkcItem) || tag.kind_of?(TkcTag) tag.id diff --git a/ext/tk/lib/tk/entry.rb b/ext/tk/lib/tk/entry.rb index 63051979e6..4ac3f28229 100644 --- a/ext/tk/lib/tk/entry.rb +++ b/ext/tk/lib/tk/entry.rb @@ -21,6 +21,11 @@ class TkEntry<TkLabel #end #private :create_self + def __strval_optkeys + super() + ['show', 'disabledbackground', 'readonlybackground'] + end + private :__strval_optkeys + def bbox(index) list(tk_send_without_enc('bbox', index)) end diff --git a/ext/tk/lib/tk/frame.rb b/ext/tk/lib/tk/frame.rb index 519b9ae8a6..6636fef5b5 100644 --- a/ext/tk/lib/tk/frame.rb +++ b/ext/tk/lib/tk/frame.rb @@ -30,6 +30,11 @@ class TkFrame<TkWindow # end ################# + def __boolval_optkeys + super() << 'container' + end + private :__boolval_optkeys + def initialize(parent=nil, keys=nil) my_class_name = nil if self.class < WidgetClassNames[self.class::WidgetClassName] diff --git a/ext/tk/lib/tk/image.rb b/ext/tk/lib/tk/image.rb index e3880106a4..35e2c4e394 100644 --- a/ext/tk/lib/tk/image.rb +++ b/ext/tk/lib/tk/image.rb @@ -96,6 +96,11 @@ class TkImage<TkObject end class TkBitmapImage<TkImage + def __strval_optkeys + super() + ['maskdata', 'maskfile'] + end + private :__strval_optkeys + def initialize(*args) @type = 'bitmap' super(*args) diff --git a/ext/tk/lib/tk/itemconfig.rb b/ext/tk/lib/tk/itemconfig.rb index ac04cdefe9..0b84be38b8 100644 --- a/ext/tk/lib/tk/itemconfig.rb +++ b/ext/tk/lib/tk/itemconfig.rb @@ -19,13 +19,19 @@ module TkItemConfigOptkeys private :__item_numstrval_optkeys def __item_boolval_optkeys(id) - [] + ['exportselection', 'jump', 'setgrid', 'takefocus'] end private :__item_boolval_optkeys def __item_strval_optkeys(id) # maybe need to override - ['text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile'] + [ + 'text', 'label', 'show', 'data', 'file', 'maskdata', 'maskfile', + 'activebackground', 'activeforeground', 'background', + 'disabledforeground', 'disabledbackground', 'foreground', + 'highlightbackground', 'highlightcolor', 'insertbackground', + 'selectbackground', 'selectforeground', 'troughcolor' + ] end private :__item_strval_optkeys diff --git a/ext/tk/lib/tk/labelframe.rb b/ext/tk/lib/tk/labelframe.rb index fd16d3419d..73d5603200 100644 --- a/ext/tk/lib/tk/labelframe.rb +++ b/ext/tk/lib/tk/labelframe.rb @@ -16,5 +16,10 @@ class TkLabelFrame<TkFrame # end #end #private :create_self + + def __val2ruby_optkeys # { key=>proc, ... } + super().update('labelwidget'=>proc{|v| window(v)}) + end + private :__val2ruby_optkeys end TkLabelframe = TkLabelFrame diff --git a/ext/tk/lib/tk/listbox.rb b/ext/tk/lib/tk/listbox.rb index 295a9bf88c..41d02d279e 100644 --- a/ext/tk/lib/tk/listbox.rb +++ b/ext/tk/lib/tk/listbox.rb @@ -32,6 +32,11 @@ class TkListbox<TkTextWin #end #private :create_self + def __tkvariable_optkeys + super() << 'listvariable' + end + private :__tkvariable_optkeys + def tagid(id) #id.to_s _get_eval_string(id) diff --git a/ext/tk/lib/tk/menu.rb b/ext/tk/lib/tk/menu.rb index 54b42705e5..e366816d57 100644 --- a/ext/tk/lib/tk/menu.rb +++ b/ext/tk/lib/tk/menu.rb @@ -18,11 +18,21 @@ module TkMenuEntryConfig end private :__item_config_cmd + def __item_strval_optkeys(id) + super(id) << 'selectcolor' + end + private :__item_strval_optkeys + def __item_listval_optkeys(id) [] end private :__item_listval_optkeys + def __item_val2ruby_optkeys(id) # { key=>proc, ... } + super(id).update('menu'=>proc{|i, v| window(v)}) + end + private :__val2ruby_optkeys + alias entrycget itemcget alias entryconfigure itemconfigure alias entryconfiginfo itemconfiginfo @@ -49,6 +59,16 @@ class TkMenu<TkWindow #end #private :create_self + def __strval_optkeys + super() << 'selectcolor' << 'title' + end + private :__strval_optkeys + + def __boolval_optkeys + super() << 'tearoff' + end + private :__boolval_optkeys + def self.new_menuspec(menu_spec, parent = nil, tearoff = false, keys = nil) if parent.kind_of?(Hash) keys = _symbolkey2str(parent) @@ -411,6 +431,12 @@ class TkMenubutton<TkLabel end end private :create_self + + def __boolval_optkeys + super() << 'indicatoron' + end + private :__boolval_optkeys + end TkMenuButton = TkMenubutton diff --git a/ext/tk/lib/tk/radiobutton.rb b/ext/tk/lib/tk/radiobutton.rb index d82aa5d07d..f8f67d709a 100644 --- a/ext/tk/lib/tk/radiobutton.rb +++ b/ext/tk/lib/tk/radiobutton.rb @@ -17,6 +17,16 @@ class TkRadioButton<TkButton #end #private :create_self + def __boolval_optkeys + super() << 'indicatoron' + end + private :__boolval_optkeys + + def __strval_optkeys + super() << 'selectcolor' + end + private :__strval_optkeys + def __ruby2val_optkeys # { key=>proc, ... } { 'variable'=>proc{|v| tk_trace_variable(v)} # for backward compatibility diff --git a/ext/tk/lib/tk/scale.rb b/ext/tk/lib/tk/scale.rb index 7214c46f5e..0b703aa055 100644 --- a/ext/tk/lib/tk/scale.rb +++ b/ext/tk/lib/tk/scale.rb @@ -24,6 +24,11 @@ class TkScale<TkWindow end private :create_self + def __strval_optkeys + super() << 'label' + end + private :__strval_optkeys + def _wrap_command_arg(cmd) proc{|val| if val.kind_of?(String) diff --git a/ext/tk/lib/tk/spinbox.rb b/ext/tk/lib/tk/spinbox.rb index 8941510fed..9a10977d12 100644 --- a/ext/tk/lib/tk/spinbox.rb +++ b/ext/tk/lib/tk/spinbox.rb @@ -64,6 +64,21 @@ class TkSpinbox<TkEntry #end #private :create_self + def __boolval_optkeys + super() << 'wrap' + end + private :__boolval_optkeys + + def __strval_optkeys + super() << 'buttonbackground' << 'format' + end + private :__strval_optkeys + + def __listval_optkeys + super() << 'values' + end + private :__listval_optkeys + def identify(x, y) tk_send_without_enc('identify', x, y) end diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index f2bad37b01..bd5de278cf 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -187,6 +187,11 @@ class TkText<TkTextWin end private :create_self + def __strval_optkeys + super() << 'inactiveseletcionbackground' + end + private :__strval_optkeys + def self.at(x, y) TkText::IndexString.at(x, y) end diff --git a/ext/tk/lib/tk/toplevel.rb b/ext/tk/lib/tk/toplevel.rb index 33920aba77..5e199e1330 100644 --- a/ext/tk/lib/tk/toplevel.rb +++ b/ext/tk/lib/tk/toplevel.rb @@ -45,6 +45,21 @@ class TkToplevel<TkWindow # end ################# + def __boolval_optkeys + super() << 'container' + end + private :__boolval_optkeys + + def __strval_optkeys + super() << 'screen' + end + private :__strval_optkeys + + def __val2ruby_optkeys # { key=>proc, ... } + super().update('menu'=>proc{|v| window(v)}) + end + private :__val2ruby_optkeys + def __methodcall_optkeys # { key=>method, ... } TOPLEVEL_METHODCALL_OPTKEYS end |