Method: Gtk::Label#initialize

Defined in:
lib/gtk3/label.rb

#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