Class: QuickStart::QuickStart2Glade
- Inherits:
-
Object
- Object
- QuickStart::QuickStart2Glade
- Includes:
- GetText
- Defined in:
- lib/quick_start/ui/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
- #show ⇒ Object
Constructor Details
#initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) ⇒ QuickStart2Glade
Returns a new instance of QuickStart2Glade.
8 9 10 11 12 |
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 8 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)} @selected_map = {} end |
Instance Attribute Details
#glade ⇒ Object (readonly)
Returns the value of attribute glade.
6 7 8 |
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 6 def glade @glade end |
Instance Method Details
#on_btn_run_clicked(widget) ⇒ Object
37 38 39 40 41 42 43 44 45 |
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 37 def on_btn_run_clicked() Core.config.executables.each do |e| next unless e.checked? show_status( "Running #{e.name}", e.name ) do e.run end end Gtk.main_quit end |
#on_chb_application_toggled(widget) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 29 def on_chb_application_toggled() if .active? selected << .name else selected.delete( .name ) end end |
#show ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 14 def show @window = glade['main_window'] = Gtk::VButtonBox.new Core.config.executables.each do |e| .add( ( e ) ) glade['box_config_programs_labels'].add( Gtk::Label.new( e.name.to_s ) ) glade['box_config_programs_paths'].add( Gtk::Label.new( e.path ) ) glade['box_config_programs_remove'].add( Gtk::Button.new( "Remove" ) ) end glade['box_programs'].add( ) @window.show_all @window.signal_connect('destroy') { Gtk.main_quit } end |