Sha256: 5c09679533ea765ac42b79ef65c3596db9cfc641aa07631c9ea1c34ad085976d

Contents?: true

Size: 429 Bytes

Versions: 9

Compression:

Stored size: 429 Bytes

Contents

require 'ffi-tk'

Tk.init

label = Tk::Label.new(Tk.root, text: 'Here will be the value of button displayed')
label.pack

var = Tk.option_menu('.foo', 'Yes', 'Of course', 'Maybe', 'Maybe not', 'No', 'Never')
Tk::Pack.pack('.foo')
Tk::Bind.bind('.foo', '<Configure>'){ label.configure(text: var.get) }
var.set 'Maybe' # initial option

label.configure text: var.get

Tk::Button.new(Tk.root, text: 'Exit'){ exit }.pack

Tk.mainloop

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-tk-2010.08.23 example/option_menu.rb
ffi-tk-2010.08 example/option_menu.rb
ffi-tk-2010.06 example/option_menu.rb
ffi-tk-2010.03 example/option_menu.rb
ffi-tk-2010.02 example/option_menu.rb
ffi-tk-2010.01 example/option_menu.rb
ffi-tk-2010.01.02 example/option_menu.rb
ffi-tk-2009.12.14 example/option_menu.rb
ffi-tk-2009.11.29 example/option_menu.rb