On a general note:

Sprites are NOT apparent in application code. This applies to both class as well as theme code. On that level, you're just dealing with the individual images (via their resource id's).

A consequence of that is that your app code doesn't change, whether you're employing sprites or not.

Sprites are handled in the framework classes automatically. If the app requires an indvidual image, and that image is available as part of a sprite (and the context permits it), the sprite clipping is used. That's all.

HTH,
T.

On 06/29/2011 05:45 PM, Andrew Goldberg wrote:
Hi all,

I was wondering if anyone has an example demonstrating how to use image sprites for different button states?

I understand that sprites work by setting the background position of a background image, but I'm having trouble figuring out what widget to use for this effect, and where I specify the image source. So far, the approach I've tried is the following: I have a qx.ui.form.Button widget, which has an appearance "header-button", and I tried creating another appearance selector "header-button/icon" that specifies different decorators for different states. Each decorator has a different backgroundPosition value. I want to be able to specify the image source in the main JS code that sets up my form---it would be a pain to create a different appearance and set of decorators for each individual button/image. My current thought was to try to create the button without an image source specified and then dynamically set the decorator's background image. But this didn't work. I did not try simply setting the button's image sources as usual, since I don't see how changing the backgroundPosition in the decorator would make its way to the position of the image inside in the button.

Any tips on how to hook all this up would be much appreciated. Thanks!

Andrew Goldberg



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2


_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to