class Tk::Tile::ComboBox
combobox combines a text field with a pop-down list of values. the user may select the value of the text field from among the values in the list.
Public Class Methods
new(parent = Tk.root, options = {})
click to toggle source
Calls superclass method
Tk::Widget::new
# File lib/ffi-tk/widget/tile/combobox.rb, line 14 def initialize(parent = Tk.root, options = {}) super end
tk_command()
click to toggle source
# File lib/ffi-tk/widget/tile/combobox.rb, line 7 def self.tk_command 'ttk::combobox' end
Public Instance Methods
current(newindex = None)
click to toggle source
If newIndex is supplied, sets the combobox value to the element at position newIndex in the list of -values. Otherwise, returns the index of the current value in the list of -values or -1 if the current value does not appear in the list.
# File lib/ffi-tk/widget/tile/combobox.rb, line 36 def current(newindex = None) if None == newindex execute(:current) else execute_only(:current, newindex) end end
get()
click to toggle source
Returns the current value of the combobox.
# File lib/ffi-tk/widget/tile/combobox.rb, line 28 def get execute(:get).to_s end
postcommand(&block)
click to toggle source
# File lib/ffi-tk/widget/tile/combobox.rb, line 18 def postcommand(&block) configure(postcommand: block) if block end
set(value)
click to toggle source
Sets the value of the combobox to value.
# File lib/ffi-tk/widget/tile/combobox.rb, line 23 def set(value) execute_only(:set, value) end