Class: Interphase::MessageDialog
- Defined in:
- lib/interphase/widgets/dialog.rb
Overview
A message dialog which displays text and some buttons.
Instance Attribute Summary
Attributes inherited from Widget
Class Method Summary collapse
-
.show(message) ⇒ Object
A helper method which creates a new
MessageDialog
, adds an OK button, displays it, blocks until ‘OK’ is clicked, then destroys it.
Instance Method Summary collapse
-
#initialize(message, **options, &block) ⇒ MessageDialog
constructor
Create a new message dialog.
Methods inherited from Dialog
#action_to_integer, #add_button, #run
Methods inherited from Widget
#destroy, #method_missing, #on, #respond_to_missing?, #show, #size
Constructor Details
#initialize(message, **options, &block) ⇒ MessageDialog
Create a new message dialog.
message
-
The message which the dialog displays.
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/interphase/widgets/dialog.rb', line 55 def initialize(, **, &block) super( Gtk::MessageDialog.new( nil, 0, Gtk::MessageDialog::OTHER, Gtk::MessageDialog::BUTTONS_NONE, ), , &block ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Interphase::Widget
Class Method Details
.show(message) ⇒ Object
A helper method which creates a new MessageDialog
, adds an OK button, displays it, blocks until ‘OK’ is clicked, then destroys it.
message
-
The message which the dialog displays.
71 72 73 74 75 76 |
# File 'lib/interphase/widgets/dialog.rb', line 71 def self.show() dialog = MessageDialog.new() dialog.('OK', :ok) dialog.run dialog.destroy end |