Method: Fidgit::ComboBox#initialize
- Defined in:
- lib/fidgit/elements/combo_box.rb
#initialize(options = {}, &block) ⇒ ComboBox
Returns a new instance of ComboBox.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fidgit/elements/combo_box.rb', line 39 def initialize( = {}, &block) = { background_color: default(:background_color), border_color: default(:border_color), }.merge! @value = [:value] @hover_index = 0 @menu = MenuPane.new(show: false) do subscribe :selected do |, value| self.value = value end end @@arrow ||= Gosu::Image[ARROW_IMAGE] super('', ) rect.height = [height, font.height + padding_top + padding_bottom].max rect.width = [width, font.height * 4 + padding_left + padding_right].max end |