perl-Gtk2 r2095 - in trunk: . t xs



Author: tsch
Date: Sat Nov 22 14:49:27 2008
New Revision: 2095
URL: http://svn.gnome.org/viewvc/perl-Gtk2?rev=2095&view=rev

Log:
Wrap gtk_get_option_group.


Modified:
   trunk/ChangeLog
   trunk/t/00.Gtk2.t
   trunk/xs/Gtk2.xs

Modified: trunk/t/00.Gtk2.t
==============================================================================
--- trunk/t/00.Gtk2.t	(original)
+++ trunk/t/00.Gtk2.t	Sat Nov 22 14:49:27 2008
@@ -15,7 +15,7 @@
 
 # NOTE: this is the bootstrap test -- no Gtk2::TestHelper here!
 
-use Test::More tests => 43;
+use Test::More tests => 44;
 BEGIN { use_ok('Gtk2', ':constants') };
 
 #########################
@@ -154,6 +154,24 @@
 	ok(1);
 }
 
+SKIP: {
+	skip 'new 2.6 stuff', 1
+		unless Gtk2->CHECK_VERSION(2, 6, 0);
+
+	my $foos = 1;
+	my $options = [
+		[ 'foos', 'f', 'int', \$foos ],
+	];
+
+	my $context = Glib::OptionContext->new ('- urgsify your life');
+	$context->add_main_entries ($options, 'C');
+	$context->add_group (Gtk2->get_option_group (1));
+
+	@ARGV = qw(--name Foo --foos 23);
+	$context->parse ();
+	is ($foos, 23);
+}
+
 __END__
 
 Copyright (C) 2003-2004 by the gtk2-perl team (see the file AUTHORS for the

Modified: trunk/xs/Gtk2.xs
==============================================================================
--- trunk/xs/Gtk2.xs	(original)
+++ trunk/xs/Gtk2.xs	Sat Nov 22 14:49:27 2008
@@ -361,6 +361,22 @@
 
 #endif
 
+#if GTK_CHECK_VERSION(2, 6, 0)
+
+# I see no way to wrap this.  Bare GOptionEntries don't carry enough context to
+# let us setup the SV synchronization.  We would need to be able to pass in a
+# whole GOptionGroup.
+##  gboolean gtk_init_with_args (int *argc, char ***argv, char *parameter_string, GOptionEntry *entries, char *translation_domain, GError **error);
+
+##  GOptionGroup *gtk_get_option_group (gboolean open_default_display);
+GOptionGroup_own *
+gtk_get_option_group (class, open_default_display)
+	gboolean open_default_display
+    C_ARGS:
+	open_default_display
+
+#endif
+
  ##void           gtk_disable_setlocale    (void);
 void gtk_disable_setlocale (class)
     C_ARGS:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]