Method: Gtk::Button#initialize

Defined in:
lib/gtk4/button.rb

#initialize(options = {}) ⇒ Button



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gtk4/button.rb', line 20

def initialize(options={})
  label = options[:label]
  use_underline = options[:use_underline]
  if use_underline.nil?
    mnemonic = options[:mnemonic]
    if mnemonic
      label = mnemonic
      use_underline = true
    end
  end
  icon_name = options[:icon_name]

  if label
    if use_underline
      initialize_new_with_mnemonic(label)
    else
      initialize_new_with_label(label)
    end
  elsif icon_name
    initialize_new_from_icon_name(icon_name)
  else
    initialize_raw
  end
end