Class: JLDrill::Gtk::InfoWindow
- Inherits:
-
Gtk::Dialog
- Object
- Gtk::Dialog
- JLDrill::Gtk::InfoWindow
- Includes:
- Context::Gtk::Widget
- Defined in:
- lib/jldrill/views/gtk/widgets/InfoWindow.rb
Instance Attribute Summary
Attributes included from Context::Gtk::Widget
Instance Method Summary collapse
- #addContents(string) ⇒ Object
- #execute(string) ⇒ Object
-
#initialize(view) ⇒ InfoWindow
constructor
A new instance of InfoWindow.
Methods included from Context::Gtk::Widget
#addToThisWidget, #afterWidgetIsAdded, #afterWidgetIsRemoved, #expandWidgetHeight, #expandWidgetHeight?, #expandWidgetWidth, #expandWidgetWidth?, #gtkAddWidget, #gtkRemoveWidget, #isAMainWindow, #isInTests?, #removeFromThisWidget, #setupWidget, #widgetWasAddedTo, #widgetWasRemovedFrom
Constructor Details
#initialize(view) ⇒ InfoWindow
Returns a new instance of InfoWindow.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/jldrill/views/gtk/widgets/InfoWindow.rb', line 9 def initialize(view) @view = view super("Info", nil, Gtk::Dialog::DESTROY_WITH_PARENT, [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_ACCEPT]) sw = Gtk::ScrolledWindow.new sw.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC) sw.shadow_type = Gtk::SHADOW_IN self.vbox.add(sw) @contents = Gtk::TextView.new @contents.wrap_mode = Gtk::TextTag::WRAP_WORD @contents.editable = false @contents.cursor_visible = false sw.add(@contents) self.set_default_size(600, 360) end |
Instance Method Details
#addContents(string) ⇒ Object
28 29 30 |
# File 'lib/jldrill/views/gtk/widgets/InfoWindow.rb', line 28 def addContents(string) @contents.buffer.text = string end |
#execute(string) ⇒ Object
32 33 34 35 |
# File 'lib/jldrill/views/gtk/widgets/InfoWindow.rb', line 32 def execute(string) addContents(string) run end |