Sha256: f882b43d591e39c1f4b0cde79b7db3ce74b84eeb011f2cc8bb82062395c449bf

Contents?: true

Size: 836 Bytes

Versions: 9

Compression:

Stored size: 836 Bytes

Contents

#!/usr/bin/env ruby

require_relative '../../lib/ffi-tk'

Tk.init


Tk::Tile::Style.theme_settings 'alt' do
  Tk::Tile::Style.configure '.', background: 'red'
  Tk::Tile::Style.configure 'test.label', background: 'blue'

  Tk::Tile::Style.map('.', :background=>[:active, '#694418'])
end


button1 = Tk::Tile::Button.new('.', text: 'Hello, World!', width: 100) do
  button1.destroy
  Tk.exit
end

button2 = Tk::Tile::Button.new(button1, text: 'Wien!', width: 50) do
  Tk::Tile::Style.map('.', :background=>[:active, '#FFFFFF'])
  button2.destroy
end

#button3 = Tk::Tile::Button.new(button1, text: 'apply theme', style: 'test.label' ) do
button3 = Tk::Tile::Button.new('.', text: 'apply theme' ) do
  Tk::Tile::Style.theme_use 'alt'
  button3.destroy
end
#button3.style 'test.label'


button1.pack
button2.pack
button3.pack

Tk.mainloop

Version data entries

9 entries across 9 versions & 1 rubygems

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