Class: RunnerManager

Inherits:
TkFloatTitledFrame show all
Defined in:
lib/a-core.rb

Defined Under Namespace

Classes: RunnerMangerItem

Constant Summary

Constants included from TkResizable

TkResizable::MIN_HEIGHT, TkResizable::MIN_WIDTH

Instance Attribute Summary

Attributes inherited from TkBaseTitledFrame

#frame, #top

Instance Method Summary collapse

Methods inherited from TkFloatTitledFrame

#head_buttons, #hide, #hide_if_visible, #on_arcadia, #on_close=, #show, #show_grabbed, #title

Methods included from TkResizable

#resizing_do_move_obj, #resizing_do_press, #start_resizing, #stop_resizing

Methods included from TkMovable

#moving_do_move_obj, #moving_do_press, #start_moving, #stop_moving

Methods inherited from TkBaseTitledFrame

#add_fixed_button, #add_fixed_menu_button, #add_fixed_panel, #add_fixed_sep, #create_frame, #head_buttons, #menu_button, #visible?

Constructor Details

#initialize(_parent) ⇒ RunnerManager

Returns a new instance of RunnerManager.



1757
1758
1759
1760
1761
1762
# File 'lib/a-core.rb', line 1757

def initialize(_parent)
  super(_parent)
  title("Runners manager")
  @items = Hash.new
  place('x'=>100,'y'=>100,'height'=> 220,'width'=> 300)
end

Instance Method Details

#clear_itemsObject



1764
1765
1766
1767
# File 'lib/a-core.rb', line 1764

def clear_items
  @items.each_value{|i| i.destroy }
  @items.clear
end

#load_itemsObject



1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'lib/a-core.rb', line 1769

def load_items
  clear_items
  runs=Arcadia.pers_group('runners', true)
  runs.each{|name, hash_string|
    item_hash = eval hash_string
    item_hash[:name]=name
    if item_hash[:runner] && Arcadia.runner(item_hash[:runner])
      item_hash = Hash.new.update(Arcadia.runner(item_hash[:runner])).update(item_hash)
    end
    @items[name]=RunnerMangerItem.new(self.frame, item_hash)
  }
end