Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Display Size with dual head?
Display Size with dual head? [message #531858] Thu, 06 May 2010 12:08 Go to next message
Thomas Kratz is currently offline Thomas KratzFriend
Messages: 165
Registered: July 2009
Senior Member
HI i guess this is rather a simple question, but Ido not get it. I used to place a startup dialog in the middle of the screen by asking for the display size. but with a dual head this places the dialog half on one screen half on the other. what would be a nice way to have a dialog centered on the primary screen ?
Re: Display Size with dual head? [message #531978 is a reply to message #531858] Thu, 06 May 2010 16:10 Go to previous message
Eclipse UserFriend
Originally posted by: 6lackbird.dev.gmail.com

Thomas Kratz пишет:
> HI i guess this is rather a simple question, but Ido not get it. I
> used to place a startup dialog in the middle of the screen by asking
> for the display size. but with a dual head this places the dialog half
> on one screen half on the other. what would be a nice way to have a
> dialog centered on the primary screen ?
> public static void centre(Shell shell) {
> Rectangle bounds =
> shell.getDisplay().*getPrimaryMonitor()*.getBounds();
>
> shell.setLocation(
> bounds.width / 2 - shell.getSize().x / 2,
> bounds.height / 2 - shell.getSize().y / 2
> );
> }
Previous Topic:icons in Combo...
Next Topic:Proxy type in swt.Browser
Goto Forum:
  


Current Time: Fri Apr 26 23:57:31 GMT 2024

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

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

Back to the top