Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Disposing of items in the Gallery
Disposing of items in the Gallery [message #51672] Fri, 18 April 2008 03:45 Go to next message
Trevor Campbell is currently offline Trevor CampbellFriend
Messages: 23
Registered: July 2009
Junior Member
I am using the Gallery to show a collection of Images and need to dispose
of the image resources when they are no longer needed.

I tried:
DisposeListener mImageDisposalListener = new DisposeListener()
{
@Override
public void widgetDisposed(DisposeEvent e)
{
GalleryItem item = (GalleryItem) e.widget;
item.getImage().dispose();
}

};
galleryItem.addDisposeListener(mImageDisposalListener);
but have found that the widgetDisposed event is not being fired when the
container is disposed of.

Is this a bug? or should I be trying to track and dispose of all the image
resources myself.
Re: Disposing of items in the Gallery [message #51969 is a reply to message #51672] Thu, 24 April 2008 06:54 Go to previous messageGo to next message
Nicolas Richeton is currently offline Nicolas RichetonFriend
Messages: 179
Registered: July 2009
Senior Member
Hi Trevor,

Managing the images this way can lead to a large number of open handles,
but as long as you only display a reasonable number of image, it is ok.

In ShareMedia
( http://sourceforge.net/project/screenshots.php?group_id=1669 62&ssid=69060),
I can display a very large number of Image in a single Gallery so I only
keep a small subset in memory and Images are created on display (using
the paint event).

All SWT events are not yet implemented in Gallery. But if Table or Tree
has this behavior, please open a bug and I'll fix this asap.

--
Nicolas

Trevor Campbell a écrit :
> I am using the Gallery to show a collection of Images and need to
> dispose of the image resources when they are no longer needed.
>
> I tried:
> DisposeListener mImageDisposalListener = new DisposeListener()
> {
> @Override
> public void widgetDisposed(DisposeEvent e)
> {
> GalleryItem item = (GalleryItem) e.widget;
> item.getImage().dispose();
> }
>
> };
> galleryItem.addDisposeListener(mImageDisposalListener);
> but have found that the widgetDisposed event is not being fired when the
> container is disposed of.
>
> Is this a bug? or should I be trying to track and dispose of all the
> image resources myself.
>
Re: Disposing of items in the Gallery [message #52020 is a reply to message #51969] Fri, 25 April 2008 00:26 Go to previous message
Trevor Campbell is currently offline Trevor CampbellFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks Nicolas. I have raised bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=228798.

Regards
Trevor
Re: Disposing of items in the Gallery [message #589447 is a reply to message #51672] Thu, 24 April 2008 06:54 Go to previous message
Nicolas Richeton is currently offline Nicolas RichetonFriend
Messages: 179
Registered: July 2009
Senior Member
Hi Trevor,

Managing the images this way can lead to a large number of open handles,
but as long as you only display a reasonable number of image, it is ok.

In ShareMedia
( http://sourceforge.net/project/screenshots.php?group_id=1669 62&ssid=69060),
I can display a very large number of Image in a single Gallery so I only
keep a small subset in memory and Images are created on display (using
the paint event).

All SWT events are not yet implemented in Gallery. But if Table or Tree
has this behavior, please open a bug and I'll fix this asap.

--
Nicolas

Trevor Campbell a écrit :
> I am using the Gallery to show a collection of Images and need to
> dispose of the image resources when they are no longer needed.
>
> I tried:
> DisposeListener mImageDisposalListener = new DisposeListener()
> {
> @Override
> public void widgetDisposed(DisposeEvent e)
> {
> GalleryItem item = (GalleryItem) e.widget;
> item.getImage().dispose();
> }
>
> };
> galleryItem.addDisposeListener(mImageDisposalListener);
> but have found that the widgetDisposed event is not being fired when the
> container is disposed of.
>
> Is this a bug? or should I be trying to track and dispose of all the
> image resources myself.
>
Re: Disposing of items in the Gallery [message #589467 is a reply to message #51969] Fri, 25 April 2008 00:26 Go to previous message
Trevor Campbell is currently offline Trevor CampbellFriend
Messages: 23
Registered: July 2009
Junior Member
Thanks Nicolas. I have raised bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=228798

Regards
Trevor
Previous Topic:Need help to control scrolling in the gallery
Next Topic:Date selection widgets and DataBinding
Goto Forum:
  


Current Time: Fri Mar 29 11:27:09 GMT 2024

Powered by FUDForum. Page generated in 0.02053 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top