Class: QuickStart::QuickStart2Glade
- Inherits:
-
Object
- Object
- QuickStart::QuickStart2Glade
- Includes:
- GetText
- Defined in:
- lib/quick_start/quick_start_2_glade.rb
Instance Attribute Summary collapse
-
#glade ⇒ Object
readonly
Returns the value of attribute glade.
Instance Method Summary collapse
-
#initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) ⇒ QuickStart2Glade
constructor
A new instance of QuickStart2Glade.
- #on_btn_run_clicked(widget) ⇒ Object
- #on_chb_application_toggled(widget) ⇒ Object
- #selected ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) ⇒ QuickStart2Glade
Returns a new instance of QuickStart2Glade.
10 11 12 13 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 10 def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) bindtextdomain(domain, localedir, nil, "UTF-8") @glade = GladeXML.new(path_or_data, root, domain, localedir, flag) {|handler| method(handler)} end |
Instance Attribute Details
#glade ⇒ Object (readonly)
Returns the value of attribute glade.
8 9 10 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 8 def glade @glade end |
Instance Method Details
#on_btn_run_clicked(widget) ⇒ Object
29 30 31 32 33 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 29 def on_btn_run_clicked() selected.each do |name| Program.run( name.sub(/^chb_/, '') ) end end |
#on_chb_application_toggled(widget) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 21 def on_chb_application_toggled() if .active? selected << .name else selected.delete( .name ) end end |
#selected ⇒ Object
35 36 37 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 35 def selected @@selected ||= Program.map.keys.collect { |p| "chb_#{p}" } end |
#show ⇒ Object
15 16 17 18 19 |
# File 'lib/quick_start/quick_start_2_glade.rb', line 15 def show @window = glade['window1'] @window.show_all @window.signal_connect('destroy') { Gtk.main_quit } end |