Class: GTK::BaseDialog

Inherits:
Gtk::Window
  • Object
show all
Defined in:
lib/wiki_lyrics/gui/gui-gtk.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, close_on_escape = true) ⇒ BaseDialog

Returns a new instance of BaseDialog.



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 54

def initialize( values, close_on_escape=true )
	super()
	@values = values
	set_window_position( Gtk::Window::POS_CENTER )
	signal_connect( "destroy" ) { Gtk.main_quit() }
	if close_on_escape
		self.signal_connect( "key_press_event" ) do |widget, event|
			destroy() if event.keyval == Gdk::Keyval::GDK_Escape
		end
	end
end

Instance Attribute Details

#acceptedObject (readonly)

Returns the value of attribute accepted.



51
52
53
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 51

def accepted
  @accepted
end

#valuesObject (readonly)

Returns the value of attribute values.



52
53
54
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 52

def values
  @values
end

Instance Method Details

#acceptObject



98
99
100
101
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 98

def accept()
	@accepted = true
	destroy()
end

#execObject



92
93
94
95
96
# File 'lib/wiki_lyrics/gui/gui-gtk.rb', line 92

def exec()
	@accepted = false
	set_modal( true )
	show_all()
end