Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Canvas with overlaid buttons speed problem
Canvas with overlaid buttons speed problem [message #659739] Tue, 15 March 2011 12:59 Go to next message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
Hi,

I have an editor which as its main component has a canvas, I have added a paintlistener to this which draws an image (png) on the background.

So far so good.

As this is a "home page" I have placed buttons in a grid over the canvas. Originally the canvas was just a plain composite, but I want to brand the product with the image.

Now the problem is one of speed, as the screen is displayed, either initially or on resize, the image is resized correctly. The buttons in the forground though take about a half a second each to display!!!.

I have read several snippets about using canvas and painlistener to render the image, but the overlaying buttons are the issue.

I got the idea from another eclipse application I saw, unfortunately this is a commercial product and not open to discussion of implementation.

Any ideas, pointers???

Regards

/Dominic
Re: Canvas with overlaid buttons speed problem [message #660056 is a reply to message #659739] Wed, 16 March 2011 17:22 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 276
Registered: July 2009
Location: India
Senior Member
This article maybe useful --> http://www.eclipse.org/articles/Article-SWT-graphics/SWT_gra phics.html

Lakshmi P Shanmugam
Re: Canvas with overlaid buttons speed problem [message #660179 is a reply to message #660056] Thu, 17 March 2011 09:20 Go to previous messageGo to next message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
Thanks for the link.

The problem is that the code works perfectly, it's just the speed of the button rendering that is the issue. If I have a standard composite as the parent, it's fine, if I have a canvas the speed is incredibly slow for each button to appear?????

Regards

/Dominic
Re: Canvas with overlaid buttons speed problem [message #661460 is a reply to message #660179] Thu, 24 March 2011 17:57 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
I took
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet172 .java ,
inserted a Canvas between the Shell and all of the Buttons, and the
performance seemed fine. Does your case's performance improve without
drawing the background image? Does using a Composite instead with a
background image set on it perform better for your case?

Grant


"Dominic Hanlan" <dominic@hanlan.org.uk> wrote in message
news:ilsjcm$8ni$1@news.eclipse.org...
> Thanks for the link.
> The problem is that the code works perfectly, it's just the speed of the
> button rendering that is the issue. If I have a standard composite as the
> parent, it's fine, if I have a canvas the speed is incredibly slow for
> each button to appear?????
>
> Regards
>
> /Dominic
Previous Topic:Problem with ColumnLayout order
Next Topic:How do I scroll to the bottom of HTML in a browser control?
Goto Forum:
  


Current Time: Wed Apr 08 10:12:03 GMT 2020

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

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

Back to the top