Layout manager on a Rectangle



Hello,

this is my first post on the ML: I am a relatively new user of Clutter, using since a week or two, I am still experimenting a bit to understand a few things not always clear.

I am using Python 3.3 and Clutter 1.14 (because I do not have 1.16 available on Fedora 19).

Oh, and I am writing a tutorial as I go, so, if you want, I can submit it for a review.

I was experimenting with layout managers, and I tried to create a simple button in this way:

1. created an Actor()
2. created a Rectangle()
3. created a Text()
4. make Text and Rectangle child of Actor
5. set BinLayout() onto Actor.

And this seems to work fine. Then I tried without the Actor, placing the Text directly on the Rectangle ( rect.add_child(text) ), using the BinLayout ( rect.set_layout_manager(BinLayout()) ), but without success: the Text seems to be vanished, I can not see it (also tried with the show() method).

I tried settings text alignment to CENTER, its position and also using the expand properties, but without success.

Can someone please explain me why it is so?
Maybe Rectangles are not made to have a layout manager?
Should I use always a third Actor for this kind of tasks?

Thanks in advance!
~Alessandro


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