Class: Grumblr::MessageDialog
- Inherits:
-
Gtk::Dialog
- Object
- Gtk::Dialog
- Grumblr::MessageDialog
- Defined in:
- lib/grumblr/ui.rb
Instance Method Summary collapse
-
#initialize(text, stock = Gtk::Stock::DIALOG_ERROR) ⇒ MessageDialog
constructor
A new instance of MessageDialog.
Constructor Details
#initialize(text, stock = Gtk::Stock::DIALOG_ERROR) ⇒ MessageDialog
Returns a new instance of MessageDialog.
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 |
# File 'lib/grumblr/ui.rb', line 436 def initialize(text, stock = Gtk::Stock::DIALOG_ERROR) super "Attention!", $gui, Gtk::Dialog::MODAL = Gtk::Label.new(text) icon = Gtk::Image.new(stock, Gtk::IconSize::DIALOG) hbox = Gtk::HBox.new(false, 20) hbox.set_border_width 20 hbox.pack_start icon, false hbox.pack_start , true self.(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_NONE) self.signal_connect(:response) { self.destroy } self.vbox.add hbox self.show_all self.run end |