summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
diff options
context:
space:
mode:
Diffstat (limited to 'jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb')
-rw-r--r--jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb b/jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
new file mode 100644
index 0000000..5278883
--- /dev/null
+++ b/jni/ruby/ext/tk/sample/tkextlib/iwidgets/sample/messagebox2.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'tk'
+require 'tkextlib/iwidgets'
+
+mb = Tk::Iwidgets::Messagebox.new(:hscrollmode=>:dynamic,
+ :labeltext=>'Messages', :labelpos=>:n,
+ :height=>120, :width=>550,
+ :savedir=>'/tmp', :textbackground=>'#d9d9d9')
+mb.pack(:padx=>5, :pady=>5, :fill=>:both, :expand=>true)
+
+error = mb.type_add(:background=>'red', :foreground=>'white', :bell=>true)
+warning = mb.type_add(:background=>'yellow', :foreground=>'black')
+info = mb.type_add(:background=>'white', :foreground=>'black')
+
+mb.issue('This is an error message in red with a beep', error)
+mb.issue('This warning message in yellow', warning)
+mb.issue('This is an informational message', info)
+
+Tk.mainloop