class

Egui::ComboBox

Inherits Reference < Object

Constructors

new(id : String, selected : String, options : Array(String), width : Float64 | Nil = nil, variant : Symbol = :button, label : String | Nil = nil, overlay : Bool = false, max_height : Float64 = 220.0)

Rendering flavors for the closed combo: :button — solid button, the chevron in a separated sub-button strip (native dropdown look) :plain — one rigid solid button, chevron inline at the right edge — no separation :field — text-input look with a raised select button pinned to the right edge (editable-combo look) label pins a placeholder shown while NOTHING is selected (selected == "", GTK3-style "Select option"); once an option is picked it takes the button. The placeholder also leads the popup list as the zero option — picking it clears the selection. overlay: true opens the list right ON TOP of the button (GTK3-style) instead of below it. width overrides the natural size; nil (the default) fits the button to the widest entry plus the arrow zone. max_height caps the open list — beyond it the popup scrolls its rows (wheel over the list, scrollbar thumb) and the keyboard walk follows the highlighted row.

Source

Instance methods

label(text : String) : self
Source
overlay(flag : Bool = true) : self
Source
show(ui : Ui, &on_select : String -> ) : Bool

on_select fires with the picked option; returns whether a new option got picked this frame.

Source
variant(v : Symbol) : self
Source