Skip to content

Commit

Permalink
adds action buttons to main.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
pithyless committed Feb 17, 2011
1 parent 5279f3b commit f7a1beb
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

RUI::Application.init('hello') do |app|
final = ScanMonocle.new('samples/01-a-100-2.png')
final = final.to_color_monocle
final = final.to_gray_monocle

widget = Qt::Widget.new
widget.gui = RUI::autogui do
Expand All @@ -16,11 +14,26 @@
label :name => :footer_label, :text => 'Footer'
end
layout :type => :vertical do
button :name => :hello, :text => 'Hello'
button :name => :colorize, :text => 'Colorize'
button :name => :grayify, :text => 'Grayify'
button :name => :quit, :text => 'Quit'
end
end
end
widget.colorize.on(:clicked) do
final = final.to_color_monocle
widget.pic_label.pixmap = final.image

# todo - should be automagic
widget.colorize.enabled = false
end
widget.grayify.on(:clicked) do
final = final.to_gray_monocle
widget.pic_label.pixmap = final.image

# todo - should be automagic
widget.grayify.enabled = false
end
widget.quit.on(:clicked) { app.exit }
widget.show
end

0 comments on commit f7a1beb

Please sign in to comment.