Class: Gtk::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/gtk3/label.rb

Instance Method Summary collapse

Constructor Details

#initialize(text = nil, options = {}) ⇒ Label

Returns a new instance of Label


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gtk3/label.rb', line 20

def initialize(text=nil, options={})
  if options == true or options == false or options.nil?
    mnemonic = options
    warn "Gtk::Label.new(text, mnemonic) style has been deprecated. " +
         "Use Gtk::Label.new(text, {:use_underline => #{mnemonic}}) style instead."
    options = {
      :use_underline => mnemonic,
    }
  end
  if options[:use_underline]
    initialize_new_with_mnemonic(text)
  else
    initialize_raw(text || "")
  end
end

Instance Method Details

#initialize_rawObject


19
# File 'lib/gtk3/label.rb', line 19

alias_method :initialize_raw, :initialize

#set_markup(text, options = {}) ⇒ Object


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/gtk3/label.rb', line 38

def set_markup(text, options={})
  if options == true or options == false or options.nil?
    mnemonic = options
    warn "Gtk::Label#set_markup(text, mnemonic) style has been deprecated. " +
         "Use Gtk::Label#set_marup(text, {:use_underline => #{mnemonic}}) style instead."
    options = {
      :use_underline => mnemonic,
    }
  end
  if options[:use_underline]
    set_markup_with_mnemonic(text)
  else
    set_markup_raw(text)
  end
end

#set_markup_rawObject


37
# File 'lib/gtk3/label.rb', line 37

alias_method :set_markup_raw, :set_markup