Skip to main content



      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 08:59 Go to next message
Eclipse UserFriend
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 13:22 Go to previous messageGo to next message
Eclipse UserFriend
This article maybe useful --> http://www.eclipse.org/articles/Article-SWT-graphics/SWT_gra phics.html
Re: Canvas with overlaid buttons speed problem [message #660179 is a reply to message #660056] Thu, 17 March 2011 05:20 Go to previous messageGo to next message
Eclipse UserFriend
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 13:57 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 01:04:41 EDT 2025

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

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

Back to the top