1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@4955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2003-11-14 04:25:11 +00:00
parent 810e7938fd
commit 906d408e7c
4 changed files with 21 additions and 12 deletions

View file

@ -1,3 +1,10 @@
Fri Nov 14 13:21:30 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c: fix (en-bugged at 2003/11/07)
* ext/tk/lib/tkdialog.rb: TkDialog.new accepts a parent widget
argument [ruby-talk:85066]
Thu Nov 13 20:53:35 2003 Tanaka Akira <akr@m17n.org> Thu Nov 13 20:53:35 2003 Tanaka Akira <akr@m17n.org>
* lib/open-uri.rb (Kernel[#.]open): hard coded URI schemes removed. * lib/open-uri.rb (Kernel[#.]open): hard coded URI schemes removed.

View file

@ -461,9 +461,7 @@ lib_eventloop_core(check_root, check_var)
} }
} }
found_event = Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT); if (Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT)) {
if (found_event) {
tick_counter++; tick_counter++;
} else { } else {
tick_counter += no_event_tick; tick_counter += no_event_tick;

View file

@ -3943,7 +3943,6 @@ class TkWindow<TkObject
def initialize(parent=nil, keys=nil) def initialize(parent=nil, keys=nil)
if parent.kind_of? Hash if parent.kind_of? Hash
keys = _symbolkey2str(parent) keys = _symbolkey2str(parent)
keydup = true
parent = keys.delete('parent') parent = keys.delete('parent')
widgetname = keys.delete('widgetname') widgetname = keys.delete('widgetname')
install_win(if parent then parent.path end, widgetname) install_win(if parent then parent.path end, widgetname)

View file

@ -48,9 +48,7 @@ class TkDialog2 < TkWindow
private :_set_button_config private :_set_button_config
# initialize tk_dialog # initialize tk_dialog
def initialize(keys = nil) def create_self(keys)
super()
@var = TkVariable.new @var = TkVariable.new
@title = title @title = title
@ -74,7 +72,6 @@ class TkDialog2 < TkWindow
@command = nil @command = nil
if keys.kind_of? Hash if keys.kind_of? Hash
keys = _symbolkey2str(keys)
@title = keys['title'] if keys.key? 'title' @title = keys['title'] if keys.key? 'title'
@message = keys['message'] if keys.key? 'message' @message = keys['message'] if keys.key? 'message'
@bitmap = keys['bitmap'] if keys.key? 'bitmap' @bitmap = keys['bitmap'] if keys.key? 'bitmap'
@ -230,8 +227,16 @@ end
# dialog for warning # dialog for warning
# #
class TkWarning2 < TkDialog2 class TkWarning2 < TkDialog2
def initialize(mes) def initialize(parent = nil, mes = nil)
super(:message=>mes) if !mes
if parent.kind_of? TkWindow
mes = ""
else
mes = parent.to_s
parent = nil
end
end
super(parent, :message=>mes)
end end
def show(mes = nil) def show(mes = nil)
@ -263,8 +268,8 @@ class TkWarning < TkWarning2
def self.show(*args) def self.show(*args)
self.new(*args) self.new(*args)
end end
def initialize(mes) def initialize(*args)
super(mes) super(*args)
show show
end end
end end