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, #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_sep, #create_frame, #head_buttons, #menu_button, #visible?

Constructor Details

#initialize(_parent) ⇒ RunnerManager

Returns a new instance of RunnerManager.



1511
1512
1513
1514
1515
1516
# File 'lib/a-core.rb', line 1511

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



1518
1519
1520
1521
# File 'lib/a-core.rb', line 1518

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

#load_itemsObject



1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
# File 'lib/a-core.rb', line 1523

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