diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/bwidget/messagedlg.rb')
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/messagedlg.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb index 9c946d0630..cc8a996f46 100644 --- a/ext/tk/lib/tkextlib/bwidget/messagedlg.rb +++ b/ext/tk/lib/tkextlib/bwidget/messagedlg.rb @@ -173,6 +173,9 @@ class Tk::BWidget::MessageDlg end def create - num_or_str(tk_call(self.class::TkCommandNames[0], @path, *hash_kv(@keys))) + # return the index of the pressed button, or nil if it is destroyed + ret = num_or_str(tk_call(self.class::TkCommandNames[0], + @path, *hash_kv(@keys))) + (ret < 0)? nil: ret end end |