Class: ButtonLabel

Inherits:
Gtk::Box
  • Object
show all
Includes:
BasicLogging
Defined in:
lib/gui/ButtonLabel.rb

Overview

Meant to be used as label for push-buttons,

objects of this class combine a text-value
with a user-provided icon.

Constant Summary

Constants included from BasicLogging

BasicLogging::DEBUG, BasicLogging::ERROR, BasicLogging::FATAL, BasicLogging::INFO, BasicLogging::Levels, BasicLogging::UNKNOWN, BasicLogging::WARN

Instance Attribute Summary

Attributes included from BasicLogging

#log_level, #target

Instance Method Summary collapse

Methods included from BasicLogging

is_muted?, #log, mute, #set_level, #set_target

Constructor Details

#initialize(text, imagefile = nil) ⇒ ButtonLabel

Returns a new instance of ButtonLabel.



27
28
29
30
31
32
33
34
35
# File 'lib/gui/ButtonLabel.rb', line 27

def initialize(text, imagefile = nil)
	super(:horizontal, 5)
	set_border_width(0)
	pack_start(Gtk::Image.new(:file => imagefile)) if imagefile
	@mlabel = Gtk::Label.new( text, :mnemonic => true)
	@mlabel.markup_with_mnemonic=text
	# debug(@mlabel.mnemonic_keyval)
	pack_start(@mlabel) 
end

Instance Method Details

#mnemonic_widget=(wd) ⇒ Object



37
38
39
# File 'lib/gui/ButtonLabel.rb', line 37

def mnemonic_widget=(wd)
	@mlabel.mnemonic_widget=(wd)
end