Class: JLDrill::Gtk::Popup
- Inherits:
-
Object
- Object
- JLDrill::Gtk::Popup
- Defined in:
- lib/jldrill/views/gtk/widgets/Popup.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#character ⇒ Object
readonly
Returns the value of attribute character.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #close ⇒ Object
- #display ⇒ Object
-
#initialize(character, mainWindow, x, y) ⇒ Popup
constructor
A new instance of Popup.
- #showBusy(bool) ⇒ Object
Constructor Details
#initialize(character, mainWindow, x, y) ⇒ Popup
Returns a new instance of Popup.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 8 def initialize(character, mainWindow, x, y) @x = x @y = y @character = character @popup = Gtk::Window.new(Gtk::Window::POPUP) @popup.set_transient_for(mainWindow) @popup.set_destroy_with_parent(true) @popup.set_window_position(Gtk::Window::POS_NONE) @hbox = Gtk::HBox.new @popup.add(@hbox) end |
Instance Attribute Details
#character ⇒ Object (readonly)
Returns the value of attribute character.
6 7 8 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 6 def character @character end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
6 7 8 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 6 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
6 7 8 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 6 def y @y end |
Instance Method Details
#close ⇒ Object
27 28 29 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 27 def close @popup.destroy end |
#display ⇒ Object
22 23 24 25 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 22 def display @popup.move(x, y) @popup.show_all end |
#showBusy(bool) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/jldrill/views/gtk/widgets/Popup.rb', line 31 def showBusy(bool) if bool @popup.window.set_cursor(Gdk::Cursor.new(Gdk::Cursor::WATCH)) else @popup.window.set_cursor(nil) end Gdk::flush() end |