Sha256: 0793e343a6155691dfff782175d778fdf3121a134c2774f17b1621edf181b9d1

Contents?: true

Size: 548 Bytes

Versions: 9

Compression:

Stored size: 548 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../lib/ffi-tk'

Tk.init

Tk.root.bind('Control-c'){|event| p event }
Tk.root.bind('Control-q'){|event| exit }

hello = Tk::Button.new('.', text: 'Push me'){
  Tk::MessageBox.new(message: 'Hello, World!')
}.pack

button = Tk::Button.new('.', text: 'Destroy me!').pack
button.bind('Enter'){|event| button.destroy }

text = Tk::Text.new('.')
text.insert 'insert', 'Hello, World!'
text.pack expand: true, fill: :both

entry = Tk::Entry.new('.')
entry.insert 'end', 'Hello, World!'
entry.pack fill: :x

Tk.mainloop

Version data entries

9 entries across 9 versions & 1 rubygems

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