[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.nebula] Re: Newbie Gallery questions

Nicolas Richeton wrote:

Hi Thomas,

This is exactly why Gallery supports pluggable item renderers. In your case,
you should just create a new ItemRenderer by extending AbstractItemRenderer.

During redraw, 'draw' is invoked for each item.

public void draw(GC gc, GalleryItem item, int index, int x, int y,
			int width, int height) {

you get an untouched area you can paint as you wish, without resizing.

width and height are the one defined with setItemSize(). If you want to draw
labels, just add a little room for them.

Works like a charm, thanks.

(You can even contribute your item renderer to Nebula :) )

If I get proud of it I will consider :-)