Class: SumPanelButton

Inherits:
Gtk::ToggleButton
  • Object
show all
Includes:
Conf
Defined in:
lib/ListHolder/ListButtonHolder/SumPanelButton.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Constructor Details

#initialize(list_holder) ⇒ SumPanelButton

Returns a new instance of SumPanelButton.



8
9
10
11
12
13
14
15
16
17
# File 'lib/ListHolder/ListButtonHolder/SumPanelButton.rb', line 8

def initialize(list_holder)
	@list_holder=list_holder
	super()
	set_relief(Gtk::ReliefStyle::NONE)
	set_image(Gtk::Image.new(Gtk::Stock::ZOOM_IN,Gtk::IconSize.from_name(get_conf(0,0,"button-size"))))
	signal_connect('toggled'){|me|
 me.list_holder.list_panel.set_visibility
 set_conf(list_holder.list.get_id,0,"sum-panel",me.active?.to_s)
	}
end

Instance Attribute Details

#list_holderObject

Returns the value of attribute list_holder.



18
19
20
# File 'lib/ListHolder/ListButtonHolder/SumPanelButton.rb', line 18

def list_holder
  @list_holder
end

Instance Method Details

#updateObject



20
21
22
# File 'lib/ListHolder/ListButtonHolder/SumPanelButton.rb', line 20

def update
 	set_active(get_conf(list_holder.list.list_id,0,"sum-panel")=="true")
end