Class: Context::Gtk::Widget
Instance Attribute Summary collapse
-
#expandHeight ⇒ Object
Returns the value of attribute expandHeight.
-
#expandWidth ⇒ Object
Returns the value of attribute expandWidth.
-
#mainWindow ⇒ Object
Returns the value of attribute mainWindow.
Attributes inherited from Widget
Class Method Summary collapse
-
.inTests ⇒ Object
Redefine this in tests so that the widgets don’t get displayed on the screen.
Instance Method Summary collapse
- #add(widget) ⇒ Object
-
#initialize(delegate) ⇒ Widget
constructor
A new instance of Widget.
- #isAMainWindow ⇒ Object
- #remove(widget) ⇒ Object
Methods inherited from Widget
Constructor Details
#initialize(delegate) ⇒ Widget
Returns a new instance of Widget.
18 19 20 21 22 23 24 |
# File 'lib/Context/Gtk/Widget.rb', line 18 def initialize(delegate) super(delegate) @mainWindow = nil # Packing hints for the container @expandHeight = false @expandWidth = false end |
Instance Attribute Details
#expandHeight ⇒ Object
Returns the value of attribute expandHeight.
7 8 9 |
# File 'lib/Context/Gtk/Widget.rb', line 7 def @expandHeight end |
#expandWidth ⇒ Object
Returns the value of attribute expandWidth.
7 8 9 |
# File 'lib/Context/Gtk/Widget.rb', line 7 def @expandWidth end |
#mainWindow ⇒ Object
Returns the value of attribute mainWindow.
7 8 9 |
# File 'lib/Context/Gtk/Widget.rb', line 7 def mainWindow @mainWindow end |
Class Method Details
.inTests ⇒ Object
Redefine this in tests so that the widgets don’t get displayed on the screen.
13 14 15 |
# File 'lib/Context/Gtk/Widget.rb', line 13 def inTests false end |
Instance Method Details
#add(widget) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/Context/Gtk/Widget.rb', line 30 def add() if !.delegate.class.ancestors.include?(Gtk::Window) .mainWindow = @mainWindow @delegate.add(.delegate) if !Widget.inTests @delegate.show_all end else .isAMainWindow .delegate.set_transient_for(@mainWindow) if !Widget.inTests .delegate.show_all end end end |
#isAMainWindow ⇒ Object
26 27 28 |
# File 'lib/Context/Gtk/Widget.rb', line 26 def isAMainWindow @mainWindow = @delegate end |