2009/4/9 Julien Pauty <[email protected]>

> 2009/4/9 Emmanuele Bassi <[email protected]>
>
>> On Thu, 2009-04-09 at 18:22 +0200, Julien Pauty wrote:
>>
>> > I'm using pyclutter. I have a container with a custom layout manager.
>> > When I call raise_top on an actor contained in my container I get a
>> > segfault. As I understand it I'm supposed to reimplement raise_child
>> > in my class. However this method is never called. Digging a bit, I
>> > found that CLUTTER_CONTAINER_GET_IFACE (container)->raise is NULL. I
>> > suppose this means that somewhere an initiatilisation is not done.
>> > Just to be sure, I also tried to implement a do_raise_child method,
>> > but this is not called either.
>> >
>> > How can I get my python method called ?
>>
>>   def do_raise (container, child, sibling):
>>      pass
>>
>> you should always look at the C API reference until pyclutter gets a
>> proper one.
>
>
> I tried with this method but it does not get called.
>
> I join a minimal example showing the problem. On  my system, the raise_top
> call makes the program crashing. Debugging show that the function pointer
> "raise" of the interface is not initialized.
>
> Cheer,
>
> Julien
>

Adding the following in clutter-base.defs partially solves the problem:

(define-virtual lower
  (of-object "ClutterContainer")
  (return-type "none")
  (parameters
    '("ClutterActor*" "actor")
    '("ClutterActor*" "sibling" (null-ok) (default NULL))
  )
)

(define-virtual raise
  (of-object "ClutterContainer")
  (return-type "none")
  (parameters
    '("ClutterActor*" "actor")
    '("ClutterActor*" "sibling" (null-ok) (default NULL))
  )
)

This raises another problem. The binding generator adds an _ after raise,
probably because this is a python keyword. I had to remove those _ from the
generated clutter.c to get it compiled. Then it works, the method do_raise
actually gets called.

Julien

Reply via email to