Class: Gtk::Button
- Inherits:
-
Object
- Object
- Gtk::Button
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtk3/button.rb,
lib/gtk3/deprecated.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Button
constructor
A new instance of Button.
- #initialize_raw ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Button
Returns a new instance of 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 44 45 46 47 48 49 50 51 |
# File 'lib/gtk3/button.rb', line 20 def initialize(={}) label = [:label] use_underline = [:use_underline] if use_underline.nil? mnemonic = [:mnemonic] if mnemonic label = mnemonic use_underline = true end end stock = [:stock_id] icon_name = [:icon_name] icon_size = [:icon_size] || :button if label if use_underline initialize_new_with_mnemonic(label) else initialize_new_with_label(label) end elsif stock initialize_new_from_stock(stock) elsif icon_name case icon_size when Symbol, String icon_size = IconSize.new(icon_size.to_s) end initialize_new_from_icon_name(icon_name, icon_size) else initialize_raw end end |
Instance Method Details
#initialize_raw ⇒ Object
19 |
# File 'lib/gtk3/button.rb', line 19 alias_method :initialize_raw, :initialize |