Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Some widgets display inconsistently in Windows XP and Vista
Some widgets display inconsistently in Windows XP and Vista [message #489281] Fri, 02 October 2009 08:45 Go to next message
Eunice Caymo is currently offline Eunice CaymoFriend
Messages: 1
Registered: July 2009
Junior Member
I tried running a plug-in application with an editor in Vista but discovered that there are some controls that are missing particularly those at the bottom part of the editor. I have not encountered this problem when developing and running the plug-in application in Windows XP. I tried to investigate the problem using both XP and Vista and noticed that the sizes of the SWT widgets created between the two OS differs, in Vista the sizes are larger which probably causes the problem since I'm defining bottom margins. Is there an API that I can use that would enable the application to dynamically re compute the sizes based on the OS or be consistent cross-platform? Or any suggestions for the best approach for creating SWT widgets that would render them correctly regardless of the OS. The widgets that I'm using that have this problem are the Button and the ColumnLayout.
Re: Some widgets display inconsistently in Windows XP and Vista [message #489675 is a reply to message #489281] Mon, 05 October 2009 14:12 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2151
Registered: July 2009
Senior Member
Hi,

Not only will your controls have different sizes on XP vs. Vista, but also
vs. GTK on Linux and vs. Cocoa on OS X. Using Layouts should generally take
care of this, as they allow your controls to lay out to their preferred
size, which varies between platforms. For info on using Layouts see
http://www.eclipse.org/articles/article.php?file=Article-Und erstanding-Layouts/index.html .

As a side note, you can use Control.computeSize(int,int) if you ever want to
know the preferred size of a Control. This result will take into account
the Control's current content (eg.- the text set on a Button or Label, etc.)

HTH,
Grant


"Eunice Caymo" <eunice.caymo@gmail.com> wrote in message
news:ha4ejs$h7l$1@build.eclipse.org...
> I tried running a plug-in application with an editor in Vista but
discovered that there are some controls that are missing particularly those
at the bottom part of the editor. I have not encountered this problem when
developing and running the plug-in application in Windows XP. I tried to
investigate the problem using both XP and Vista and noticed that the sizes
of the SWT widgets created between the two OS differs, in Vista the sizes
are larger which probably causes the problem since I'm defining bottom
margins. Is there an API that I can use that would enable the application to
dynamically re compute the sizes based on the OS or be consistent
cross-platform? Or any suggestions for the best approach for creating SWT
widgets that would render them correctly regardless of the OS. The widgets
that I'm using that have this problem are the Button and the ColumnLayout.
Previous Topic:enabledWhen with custom WorkbenchWindowControlContribution
Next Topic:Invoke getter method on pojo dynamically
Goto Forum:
  


Current Time: Tue Aug 20 07:26:00 GMT 2019

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

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

Back to the top