Class: Todoable::UI::ListsBox
- Inherits:
-
Gtk::Box
- Object
- Gtk::Box
- Todoable::UI::ListsBox
- Defined in:
- lib/todoable/ui/gtk/lists.rb
Instance Method Summary collapse
- #finish_loading ⇒ Object
-
#initialize(mainpanel) ⇒ ListsBox
constructor
A new instance of ListsBox.
- #load_lists ⇒ Object
- #start_loading ⇒ Object
Constructor Details
#initialize(mainpanel) ⇒ ListsBox
Returns a new instance of ListsBox
24 25 26 27 28 29 30 31 32 |
# File 'lib/todoable/ui/gtk/lists.rb', line 24 def initialize mainpanel super :vertical set_margin 10 @mainpanel = mainpanel # Populate widget with internal UI elements @listview = @spinner = nil add_ui_elements end |
Instance Method Details
#finish_loading ⇒ Object
51 52 53 54 |
# File 'lib/todoable/ui/gtk/lists.rb', line 51 def finish_loading @spinner.stop set_sensitive true end |
#load_lists ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/todoable/ui/gtk/lists.rb', line 34 def load_lists start_loading Thread.new do lists = @mainpanel.todoable.lists @mainpanel.jobqueue.push { @listview.clear lists.each { |list| @listview.append list } finish_loading } end end |
#start_loading ⇒ Object
46 47 48 49 |
# File 'lib/todoable/ui/gtk/lists.rb', line 46 def start_loading @spinner.start set_sensitive false end |