Skip to content

Commit

Permalink
Signals work
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed Jun 10, 2008
1 parent e74bac8 commit a9ee07c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion TODO
@@ -1,5 +1,4 @@


o iterators for array
o Make use of the faster type checks FIXNUM_P.
o Data members can be nullable
Expand All @@ -8,6 +7,7 @@
so learn about that.
o Convert Structs.

x signals
x embedding example
x Convert ENUMS
x Vala bool type should convert to Ruby true/false
Expand Down
11 changes: 11 additions & 0 deletions test/test_vlib.rb
Expand Up @@ -84,4 +84,15 @@ def test_boolean_conversion
assert_equal true, Vala::VLib.invert(false)
assert_equal false, Vala::VLib.invert(true)
end

def signals
v = Vala::VLib.new
foo = nil
v.signal_connect("sig_1") do |val|
foo = val
end
assert_nil foo
v.trigger_sig_1(101)
assert_equal 101, foo
end
end
6 changes: 6 additions & 0 deletions test/vlib/vlib.vala
Expand Up @@ -85,5 +85,11 @@ public class VLib : Object {
// i += 1;
// return i;
// }

public signal void sig_1(int a);

public void trigger_sig_1(int a) {
this.sig_1(a);
}
}

0 comments on commit a9ee07c

Please sign in to comment.