summaryrefslogtreecommitdiff
path: root/ext/tk/sample/tkextlib/iwidgets/sample/extbutton.rb
blob: fbacebc56393b14914b779c2852e17b1d7742243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby
# frozen_string_literal: false
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