Re: GTK2.TreeView()->set_model() does not work as expected

Lance Dillon <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <[email protected]>
get_gobject() is a macro define that calls get_pg2object() with the object and pg2_object_program.
It probably doesn't work with get_gobject() is because GtkTreeModel is an interface, not an object, therefore you can't actually have an instance of a tree model.  I think you therefore have to explicitly call get_pg2object() with it's type, because it can't figure out what type it is.

The + in the declaration specifies that it returns the original object type, not the current object type, I believe, which is what you want with an interface.  It is also used for methods that can be used on subclasses, such as pixbufs, that can return the parent type to be used with other methods.  Otherwise you have too much casting to do.



On Monday, October 20, 2014 1:00 PM, Chris Angelico <[email protected]> wrote:
 


On Tue, Oct 21, 2014 at 3:55 AM, Per Hedbor () @ Pike (-) importmöte
för mailinglistan <[email protected]> wrote:
> It really should not, actually.
> The generated code is more or less identical to the newly commited
> 'fixed' version.

The test case was failing, then I applied the patch, then the test
case began working. So the question is, what part of the code
difference is doing that?

What's the difference between get_pg2object() as used in the generated
code, and get_gobject() as used in Pawel's version?

ChrisA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.