View previous topic :: View next topic |
Author |
Message |
WasserDragoon
Joined: 29 Sep 2007 Posts: 23 Location: Germany
|
Posted: Wed Apr 23, 2008 6:16 am Post subject: Locating Shell on the bottom right corner (notify window) |
|
|
Hi,
im trying to locate my shell on the bottom right corner of my screen.
The problem: it works, but it overlaps my taskbar.
Here's the code:
http://paste.dprogramming.com/dprv24a9
And thats a screenshot how it looks:
And here how it should look:
Hope anyone can help me.
Thanks,
WasserDragoon. |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Wed Apr 23, 2008 9:33 am Post subject: |
|
|
If you change Code: | Rectangle screen = display.getBounds(); | to Code: | Rectangle screen = display.getClientArea(); | it works on windows but still not on gtk. I don't know how it supposed to work but getClientArea is inherited from Device and on windows in Display it's overridden but not on gtk. getClientArea in Device returns getBounds. On gtk there's a method in Display, getWorkArea, that maybe works but it doesn't exist on windows and in the online API documentation. Since this is D it can easily be fixed with a version statement if getWorkArea works.
This could also work
Code: | Monitor monitor = display.getPrimaryMonitor;
monitor.getClientArea; |
That works at least on windows |
|
Back to top |
|
|
WasserDragoon
Joined: 29 Sep 2007 Posts: 23 Location: Germany
|
Posted: Mon Apr 28, 2008 3:39 am Post subject: |
|
|
ok great i changed to:
Code: | version(Windows)
{
Rectangle screen = shell.getDisplay().getClientArea();
}
else
{
Rectangle screen = shell.getDisplay().getWorkArea();
} |
works perfect
thanks |
|
Back to top |
|
|
keinfarbton
Joined: 03 Dec 2005 Posts: 224 Location: Stuttgart - Germany
|
Posted: Tue May 06, 2008 5:05 pm Post subject: |
|
|
I think the problem here is, on linux the toolbars can be on each monitor on each side. So the overall ClientArea is probably not really a rect.
display.getMonitors() returns all Monitors and they have also a getClientArea(). This should return the correct values per Monitor.
Note: Be carefull to fully qualify Monitor, because it would conflict with that one from object.Object
Note: Display.getWorkArea is not public API, so it might go away or change behaviour in future versions.
Note: Please use the dwt newsgroup instead of this forum. |
|
Back to top |
|
|
|