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 Kratz
Messages: 163
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 User
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: Tue Sep 23 22:40:44 GMT 2014

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

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