summaryrefslogtreecommitdiff
path: root/ruby_1_8_6/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
blob: 6971052b60341cea7dfb4863b127e3cb1ca6423b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

Tk::Iwidgets::Extbutton.new(:text=>'Bitmap example', :bitmap=>'info', 
                            :background=>'bisque',  :activeforeground=>'red', 
                            :bitmapforeground=>'blue', :defaultring=>true, 
                            :command=>proc{
                              puts "Bisque is beautiful"
                            }).pack(:expand=>true)

#img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../../../images/earthris.gif'))
img = TkPhotoImage.new(:file=>File.join(File.dirname(File.expand_path(__FILE__)), '../catalog_demo/images/clear.gif'))

Tk::Iwidgets::Extbutton.new(:text=>'Image example', :relief=>:ridge, 
                            :image=>img, :imagepos=>:e, :font=>'9x15bold', 
                            :activebackground=>'lightyellow', 
                            :background=>'lightgreen').pack(:expand=>true)

Tk.mainloop