Class: MyConfig::ConfFontHolder

Inherits:
Gtk::HBox
  • Object
show all
Includes:
Conf
Defined in:
lib/MyConfig.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Constructor Details

#initialize(label_text, conf_text) ⇒ ConfFontHolder

Returns a new instance of ConfFontHolder.



38
39
40
41
42
43
44
45
# File 'lib/MyConfig.rb', line 38

def initialize(label_text,conf_text)
	@conf_text=conf_text
	super()
	pack_start(Gtk::Label.new(label_text).set_alignment(0,0.5))
	pack_end(@font_button=Gtk::FontButton.new)
	@font_button.signal_connect('font-set'){|me| set_conf(0,0,@conf_text,me.font_name)}
	@font_button.set_use_font(true)
end

Instance Attribute Details

#conf_textObject

Returns the value of attribute conf_text.



46
47
48
# File 'lib/MyConfig.rb', line 46

def conf_text
  @conf_text
end

Instance Method Details

#updateObject



48
49
50
# File 'lib/MyConfig.rb', line 48

def update
	@font_button.set_font_name(get_conf(0,0,@conf_text))
end