Re: menuitem confusion



On Sun, Jul 1, 2012 at 8:43 AM, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
On 01.07.2012 15:05, Dave M wrote:

   return Glib::Object::Introspection->invoke (
     $_GTK_BASENAME, 'RadioMenuItem', 'new',
     $class, $group);

Unfortunately, that was the FIRST thing I tried because that's what
all the examples show..  :) And it results in:

Can't find information for method RadioMenuItem::new at ./fooblah.pl


Weird, works for me:

  # perl -MGtk3 -E'Gtk3::init; warn Glib::Object::Introspection->invoke
("Gtk", "RadioMenuItem", "new", "Gtk3::RadioMenuItem", []);'
  Gtk3::RadioMenuItem=HASH(0x99e42b0) at -e line 1.

In your <prefix>/share/gir-1.0/Gtk-3.0.gir file, what's the entry for
gtk_radio_menu_item_new?  Mine is located under the class RadioMenuItem and
basically looks like this:

      <constructor name="new" c:identifier="gtk_radio_menu_item_new">
        <return-value transfer-ownership="none">
          <doc xml:whitespace="preserve">a new #GtkRadioMenuItem</doc>
          <type name="Widget" c:type="GtkWidget*"/>
        </return-value>
        <parameters>
          <parameter name="group" transfer-ownership="none">
            <type name="GLib.SList" c:type="GSList*">
              <type name="RadioMenuItem"/>
            </type>
          </parameter>
        </parameters>
      </constructor>

(You might have to install gtk+'s development package to get this file.)

Mine's close to that - just has an extra "introspectable="0"" line:

      <constructor name="new"
                   c:identifier="gtk_radio_menu_item_new"
                   introspectable="0">
        <doc xml:whitespace="preserve">Creates a new #GtkRadioMenuItem.</doc>
        <return-value transfer-ownership="none">
          <doc xml:whitespace="preserve">a new #GtkRadioMenuItem</doc>
          <type name="Widget" c:type="GtkWidget*"/>
        </return-value>
        <parameters>
          <parameter name="group" transfer-ownership="none">
            <doc xml:whitespace="preserve">the group to which the
radio menu item is to be attached</doc>
            <type name="GLib.SList" c:type="GSList*">
              <type name="gpointer" c:type="gpointer"/>
            </type>
          </parameter>
        </parameters>
      </constructor>

Is that extra line the problem?  If it worked, I would have been done
with the whole RadioMenuItem by now.  Weird!

$ rpm -qf /usr/share/gir-1.0/Gtk-3.0.gir
gtk3-devel-3.4.3-2.fc17.x86_64

Thanks,
Dave M



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