Dnia 2008-12-18, czw o godzinie 21:45 +0000, mato konecny pisze:
> I'm trying to create a universal "star widget" to show rating etc. I
> have 2 images with 5 stars ('inactive' and 'active'). In a widget I
> put them over eachother so that the 'active' stars are in the 'front'.
> Then I would like to say that let's say only 0.8 of the 'active' image
> is visible.
> It looks a bit like the images used in grid view. There,
> pgm.IMAGE_ZOOMED was used, but this creates a problem that if I change
> the width attribute of a image, the height is also altered. What I
> would like to do is to be able to modify only the drawed width without
> modifiyng the rest. I tried absolute_width, boxing the image in a HBox
> and modifiyng that one, but none of them seem to work good. The
> resulting image depends also on what's the widget parent.

If I undestand correctly, you want to mask the 'active' image.
Unfortunately I was once told that's not possible in pigment until 0.5
at least.

Anyway are you using two 5-stars wide images where the active one
overlays the inactive ones... If you want it to be universal, use
separate images (so that you can have 8 stars, if needed) and when
masking's possible, hide / mask those that shouldn't show. This way
there's place for semitransparent images there.

You shouldn't ever rely on overlaying some images to hide them - that's
what the .visible property is there for. If something shouldn't be
visible - it should really be, not just behind something else.

-- 
Michal Sawicz <[email protected]>

Reply via email to