[seed] [gtkbuilder] Override Gtk.Builder.add_from_string to automatically pass the length argument
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [gtkbuilder] Override Gtk.Builder.add_from_string to automatically pass the length argument
- Date: Tue, 14 Jul 2009 21:24:21 +0000 (UTC)
commit 5f4db73080bb6d7f5d0a6edbc5cc5eed34a01716
Author: Tim Horton <hortont svn gnome org>
Date: Tue Jul 14 17:22:52 2009 -0400
[gtkbuilder] Override Gtk.Builder.add_from_string to automatically pass the length argument
extensions/Gtk.js | 10 ++++++++++
modules/gtkbuilder/seed-gtkbuilder.c | 2 +-
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/extensions/Gtk.js b/extensions/Gtk.js
index 305e90e..286fc9f 100644
--- a/extensions/Gtk.js
+++ b/extensions/Gtk.js
@@ -27,3 +27,13 @@ Gtk = imports.gi.Gtk;
Gtk.VBox.prototype.pack = pack;
Gtk.HBox.prototype.pack = pack;
}).apply();
+
+(function()
+ {
+ var add_from_string = function(str)
+ {
+ this.add_from_string_c(str, str.length);
+ }
+ Gtk.Builder.prototype.add_from_string_c = Gtk.Builder.prototype.add_from_string;
+ Gtk.Builder.prototype.add_from_string = add_from_string;
+ }).apply();
diff --git a/modules/gtkbuilder/seed-gtkbuilder.c b/modules/gtkbuilder/seed-gtkbuilder.c
index e389fa2..6b42963 100644
--- a/modules/gtkbuilder/seed-gtkbuilder.c
+++ b/modules/gtkbuilder/seed-gtkbuilder.c
@@ -48,7 +48,7 @@ seed_gtk_builder_connect_signals(SeedContext ctx,
builder_ud ud;
GtkBuilder *b;
- CHECK_ARG_COUNT("gtkbuilder.connect_signals", 1);
+ CHECK_ARG_COUNT("GtkBuilder.connect_signals", 1);
if (!seed_value_is_object (ctx, arguments[0]))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]