Class: TT::GUI::ToolbarButton

Inherits:
Button show all
Defined in:
TT_Lib2/gui.rb

Overview

Since:

  • 2.6.0

Instance Attribute Summary collapse

Attributes inherited from Button

#caption

Attributes inherited from Control

#bottom, #font_bold, #font_italic, #font_name, #font_size, #height, #left, #name, #parent, #right, #tooltip, #top, #ui_id, #width, #window

Instance Method Summary collapse

Methods inherited from Control

#add_event_handler, #call_event, #disabled=, #disabled?, #enabled=, #enabled?, events, has_event?, #inspect, #move, #position, #positioned?, #properties, #release!, #size

Methods included from ControlEvents

included

Constructor Details

#initialize(caption, &on_click) ⇒ ToolbarButton

Returns a new instance of ToolbarButton

Parameters:

  • caption (String)
  • on_click (Proc)

Since:

  • 2.6.0



583
584
585
586
587
588
# File 'TT_Lib2/gui.rb', line 583

def initialize( caption, &on_click )
  super
  # Defaults
  @width = 28
  @height = 28
end

Instance Attribute Details

#iconObject

Since:

  • 2.6.0



577
578
579
# File 'TT_Lib2/gui.rb', line 577

def icon
  @icon
end

Instance Method Details

#custom_propertiesTT::JSON

Returns:

Since:

  • 2.6.0



592
593
594
595
596
597
598
# File 'TT_Lib2/gui.rb', line 592

def custom_properties
  # (!) Improve custom properties.
  prop = super
  #prop['caption'] = @caption
  prop['icon'] = @icon if @icon
  prop
end