Re: Odd issue when subclassing Mx.Widget rather than Clutter.Actor



Sorry to bring up an old issue, but I've finally come back to the gui coding on this project, but I'm still having trouble getting things to show up properly. I'm adding the following code to any Mx.Widget subclasses, but it doesn't seem to be doing the trick. It definitely gets called. Am I missing something?

def do_paint(self, *args):
for child in self.get_children():
child.paint()

Thanks.


On 19 December 2012 15:58, Nox Deleo <noxdeleo googlemail com> wrote:
Thanks for the reply. I tried that yesterday and it didn't help, however I tried it again now to be sure, and got a partial result (three dots showing in the top left of the widget). I guess that's a shortened label text or something, but at least it's showing something. I'll keep working at it. Thanks again.


On 19 December 2012 15:42, Lionel Landwerlin <llandwerlin gmail com> wrote:
Hi Nox,

You need to override the paint function to do so and call paint on each child.
Only some of the Mx widgets do paint their children, like the containers (BoxLayout, Grid, Viewport, KineticScrollView, ScrollView, etc...).

Cheers,
-Lionel


On 19/12/12 15:38, Nox Deleo wrote:
. If I subclass Clutter.Actor, any child widgets I place inside are automatically drawn. However if I take the same class and change it to subclass from Mx.Widget, none of the children are drawn. If I change for example the background colour of the top level widget, I see the change. I can't find anything in the Mx reference that explains this, so hopefully someone here can. I suspect it might be something to do with "realizing" the widgets, since when I checked that property, the widget and all the children had "realized" set to false. This didn't change when I called "realize" for the widget or the children.

_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list




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