seed r339 - in trunk: libseed tests
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r339 - in trunk: libseed tests
- Date: Tue, 25 Nov 2008 01:30:49 +0000 (UTC)
Author: racarr
Date: Tue Nov 25 01:30:49 2008
New Revision: 339
URL: http://svn.gnome.org/viewvc/seed?rev=339&view=rev
Log:
Move the new connect by name method to object.signal.connect to get rid of possible collision (i.e. Gtk.AccelGroup.connect)
Modified:
trunk/libseed/seed-signals.c
trunk/tests/signal-connect.js
Modified: trunk/libseed/seed-signals.c
==============================================================================
--- trunk/libseed/seed-signals.c (original)
+++ trunk/libseed/seed-signals.c Tue Nov 25 01:30:49 2008
@@ -142,7 +142,7 @@
seed_make_exception(exception, "ArgumentError", mes);
g_free(mes);
- return JSValueMakeNull(eng->context);
+ return JSValueMakeNull(ctx);
}
if(argumentCount == 3)
@@ -151,9 +151,8 @@
}
signal_name = seed_value_to_string(arguments[0], NULL);
- obj_type = G_OBJECT_TYPE(seed_value_to_object(thisObject, NULL));
-
- obj = seed_value_to_object(thisObject, NULL);
+ obj = (GObject *)JSObjectGetPrivate(thisObject);
+ obj_type = G_OBJECT_TYPE(obj);
seed_gobject_signal_connect(signal_name, obj,
(JSObjectRef) arguments[1],
@@ -173,7 +172,7 @@
type = G_OBJECT_TYPE(obj);
- signals_ref = JSObjectMake(eng->context, signal_holder_class, 0);
+ signals_ref = JSObjectMake(eng->context, signal_holder_class, obj);
while (type != 0)
{
@@ -194,7 +193,8 @@
JSObjectMakeFunctionWithCallback(eng->context, NULL,
&seed_gobject_signal_connect_by_name);
JSValueProtect(eng->context, connect_func);
- seed_object_set_property(object_ref, "connect", connect_func);
+
+ seed_object_set_property(signals_ref, "connect", connect_func);
}
void
Modified: trunk/tests/signal-connect.js
==============================================================================
--- trunk/tests/signal-connect.js (original)
+++ trunk/tests/signal-connect.js Tue Nov 25 01:30:49 2008
@@ -16,6 +16,6 @@
win = new Gtk.Window();
button = new Gtk.Button();
-win.connect("notify::opacity", handle_opacity_change, button);
+win.signal.connect("notify::opacity", handle_opacity_change, button);
win.opacity = 0.5;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]