Skip to content

Commit

Permalink
Replace #set_x with #x= in examples where this now works.
Browse files Browse the repository at this point in the history
- #title= works because title is a property for Gtk::Window.
- #urgency= and #timeout= work through method_missing.
- #border_width= doesn't work yet.
  • Loading branch information
mvz committed Mar 18, 2012
1 parent 8c7b4c0 commit d0593b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/02_hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
end

GObject.signal_connect(win, "destroy") { Gtk.main_quit }
# FIXME: #border_width= should work
win.set_border_width 10

but = Gtk::Button.new_with_label("Hello World")
Expand Down
3 changes: 2 additions & 1 deletion examples/03_upgraded_hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
Gtk.init

win = Gtk::Window.new(:toplevel)
win.set_title "Hello Buttons!"
win.title= "Hello Buttons!"

GObject.signal_connect win, "delete-event" do
Gtk.main_quit
false
end

# FIXME: #border_width= should work
win.set_border_width 10

box = Gtk::HBox.new(false, 0)
Expand Down
4 changes: 2 additions & 2 deletions examples/05_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

# Basic set up of the notification.
nf = Notify::Notification.new "Hello!", "Hi there.", "gtk-dialog-info"
nf.set_timeout 3000
nf.set_urgency :critical
nf.timeout = 3000
nf.urgency = :critical

# Show a button 'Test' in the notification, with a callback function.
nf.add_action "test", "Test", Proc.new { |obj, action, user_data|
Expand Down

0 comments on commit d0593b6

Please sign in to comment.