** Changed in: gtk
       Status: New => Expired

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gtk+3.0 in Ubuntu.
https://bugs.launchpad.net/bugs/1024492

Title:
  Gtk-3.0.gir: TreeModel.get_iter argument iter should be
  direction:inout

Status in GTK+ GUI Toolkit:
  Expired
Status in “gtk+3.0” package in Ubuntu:
  Confirmed

Bug description:
  Same for Gtk-2.0.gir

  The get_iter method is overriden by models to return a custom iter. The 
GtkTreeIter is initialised by the caller and passed to the callee who will fill 
in the user_data attribute.
  Since the direction is set to "out", the param cannot be passed to the callee 
(e.g. using pygobject).
  This makes it impossible to implement custom TreeModels with pygobject.
  A fix will be to change the direction to "in" so that the argument gets 
passed to the callee ("inout" seems not to work :/).

        <field name="get_iter">
          <callback name="get_iter">
            <return-value transfer-ownership="none">
              <doc xml:whitespace="preserve">%TRUE, if @iter was set</doc>
              <type name="gboolean" c:type="gboolean"/>
            </return-value>
            <parameters>
              <parameter name="tree_model" transfer-ownership="none">
                <type name="TreeModel" c:type="GtkTreeModel*"/>
              </parameter>
              <parameter name="iter"
                         direction="in"
                         caller-allocates="1"
                         transfer-ownership="none">
                <doc xml:whitespace="preserve">the uninitialized 
#GtkTreeIter</doc>
                <type name="TreeIter" c:type="GtkTreeIter*"/>
              </parameter>
              <parameter name="path" transfer-ownership="none">
                <doc xml:whitespace="preserve">the #GtkTreePath</doc>
                <type name="TreePath" c:type="GtkTreePath*"/>
              </parameter>
            </parameters>
          </callback>
        </field>

  As a sidenote: What I do not understand though is how the handling of
  the return value happens. Apparently a tuple is expected with the
  first argument being the boolean return value and the second argument
  seems to be copied to the iter->stamp field (the first field of the
  struct). However, it does not seem possible to set the other struct's
  fields.

  When returning anything else than a tuple, the following error is raised 
(which is ok though, because the calling convention requires to return a tuple 
there):
  
ERROR:/build/buildd/pygobject-3.2.2/gi/pygi-closure.c:317:_pygi_closure_set_out_arguments:
 code should not be reached

To manage notifications about this bug go to:
https://bugs.launchpad.net/gtk/+bug/1024492/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to