diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-14 04:25:11 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-14 04:25:11 +0000 |
| commit | 5349874252077136f51579ca397625a0dc715a7b (patch) | |
| tree | 43212608bbabe9ee3cdb7c438e39f22cccb2a040 /ext/tk | |
| parent | 9fee0c277466ac85e58705cfcc413743dcc496f3 (diff) | |
| download | ruby-5349874252077136f51579ca397625a0dc715a7b.tar.gz ruby-5349874252077136f51579ca397625a0dc715a7b.tar.xz ruby-5349874252077136f51579ca397625a0dc715a7b.zip | |
* ext/tcltklib/tcltklib.c: fix (en-bugged at 2003/11/07)
* ext/tk/lib/tkdialog.rb: TkDialog.new accepts the parent widget [ruby-talk:85066]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
| -rw-r--r-- | ext/tk/lib/tk.rb | 1 | ||||
| -rw-r--r-- | ext/tk/lib/tkdialog.rb | 21 |
2 files changed, 13 insertions, 9 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index dffa918f5..9c7a0982c 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -3943,7 +3943,6 @@ class TkWindow<TkObject def initialize(parent=nil, keys=nil) if parent.kind_of? Hash keys = _symbolkey2str(parent) - keydup = true parent = keys.delete('parent') widgetname = keys.delete('widgetname') install_win(if parent then parent.path end, widgetname) diff --git a/ext/tk/lib/tkdialog.rb b/ext/tk/lib/tkdialog.rb index febe47037..8ac598c60 100644 --- a/ext/tk/lib/tkdialog.rb +++ b/ext/tk/lib/tkdialog.rb @@ -48,9 +48,7 @@ class TkDialog2 < TkWindow private :_set_button_config # initialize tk_dialog - def initialize(keys = nil) - super() - + def create_self(keys) @var = TkVariable.new @title = title @@ -74,7 +72,6 @@ class TkDialog2 < TkWindow @command = nil if keys.kind_of? Hash - keys = _symbolkey2str(keys) @title = keys['title'] if keys.key? 'title' @message = keys['message'] if keys.key? 'message' @bitmap = keys['bitmap'] if keys.key? 'bitmap' @@ -230,8 +227,16 @@ end # dialog for warning # class TkWarning2 < TkDialog2 - def initialize(mes) - super(:message=>mes) + def initialize(parent = nil, mes = nil) + if !mes + if parent.kind_of? TkWindow + mes = "" + else + mes = parent.to_s + parent = nil + end + end + super(parent, :message=>mes) end def show(mes = nil) @@ -263,8 +268,8 @@ class TkWarning < TkWarning2 def self.show(*args) self.new(*args) end - def initialize(mes) - super(mes) + def initialize(*args) + super(*args) show end end |
