The intention of the following code is that draging the small rectangle should only move that one and not the whole group. I think this behavior is unexpected and not what is wanted in most cases. How can I prevent this behavior?

Regards
/PLu

import sys
from gi.repository import Clutter
from gi.repository import GObject

if __name__ == "__main__":

    def main():

        Clutter.init([])
        stage = Clutter.Stage()

        grp=Clutter.Group()
        grp.set_reactive(True)
        da1 = Clutter.DragAction()
        grp.add_action_with_name('drag', da1)
        stage.add_actor(grp)

        rect1= Clutter.Rectangle()
        rect1.set_color(Clutter.Color.new(255,0,0, 127))
        rect1.set_size(100,100)
        rect1.set_reactive(False)

        grp.add_actor(rect1)

        rect2= Clutter.Rectangle()
        rect2.set_color(Clutter.Color.new(0,255,0, 127))
        rect2.set_position(20,20)
        rect2.set_size(10,10)
        rect2.set_reactive(True)
        da2 = Clutter.DragAction()
        rect2.add_action_with_name('drag', da2)
        grp.add_actor(rect2)

        stage.show_all()
        Clutter.main()

    sys.exit(main())

--
Peter Lundén
Interactive Institute, Sonic Studio
Box 1197, SE-164 26 Kista, Sweden
Phone: +46 70 778 17 22
www.tii.se/sonic

_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to