Class: Rubygoo::Dialog
- Defined in:
- lib/rubygoo/dialog.rb
Constant Summary
Constants inherited from Widget
Instance Attribute Summary
Attributes inherited from Container
#bg_color, #queued_widgets, #rect, #widgets
Attributes inherited from Widget
#app, #container, #enabled, #focus_priority, #focussed, #goo_id, #h, #mouse_over, #opts, #padding_left, #padding_top, #parent, #relative, #visible, #w, #x, #y
Instance Method Summary collapse
- #added ⇒ Object
-
#close ⇒ Object
close this modal dialog.
-
#display ⇒ Object
show the dialog by adding it to the @modal_target and intercepting all of its events.
-
#initialize(opts) ⇒ Dialog
constructor
A new instance of Dialog.
- #modal? ⇒ Boolean
Methods inherited from Container
#_draw, #_key_pressed, #_key_released, #_mouse_down, #_mouse_drag, #_mouse_dragging, #_mouse_motion, #_mouse_up, #_update, #add, #clear, #get, #remove, #resize, #tab_to?
Methods inherited from Widget
#_draw, #_focus, #_key_pressed, #_key_released, #_mouse_down, #_mouse_drag, #_mouse_dragging, #_mouse_motion, #_mouse_up, #_unfocus, #_update, #contains?, #disable, #draw, #enable, #enabled?, #focus, #focussed?, #get, #get_color, goo_prop, #hide, inherited, #key_pressed, #key_released, #mouse_down, #mouse_drag, #mouse_dragging, #mouse_enter, #mouse_exit, #mouse_motion, #mouse_over?, #mouse_up, #removed, #show, #tab_to?, #theme_property, #unfocus, #update, #update_rect, #visible?
Methods included from Inflector
#camelize, #classify, #constantize, #dasherize, #demodulize, #foreign_key, #humanize, #inflections, #ordinalize, #pluralize, #singularize, #tableize, #titleize, #underscore
Constructor Details
#initialize(opts) ⇒ Dialog
Returns a new instance of Dialog.
4 5 6 7 |
# File 'lib/rubygoo/dialog.rb', line 4 def initialize(opts) super opts @modal_target = opts[:modal] end |
Instance Method Details
#added ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/rubygoo/dialog.rb', line 9 def added() super @bg_color = theme_property :bg_color @color = theme_property :color @border_color = theme_property :border_color @focus_color = theme_property :focus_color end |
#close ⇒ Object
close this modal dialog
30 31 32 |
# File 'lib/rubygoo/dialog.rb', line 30 def close() @modal_target.remove_modal self end |
#display ⇒ Object
show the dialog by adding it to the @modal_target and intercepting all of its events
25 26 27 |
# File 'lib/rubygoo/dialog.rb', line 25 def display() @modal_target.add_modal self end |
#modal? ⇒ Boolean
19 20 21 |
# File 'lib/rubygoo/dialog.rb', line 19 def modal?() @modal_target end |