D Paste by WasserDragoon
Description: Locating Shell on the right bottom of the Screen
Hide line numbers

Create new paste
Post a reply
View replies

Paste:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
module main;

import dwt.DWT;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.graphics.Rectangle;

void main()
{
    Display display = new Display();
    Shell shell = new Shell(display, DWT.NO_TRIM | DWT.ON_TOP);
    
    shell.setSize(300, 200);
    
    Rectangle screen = display.getBounds();
    Rectangle window = shell.getBounds();
    
    shell.setLocation(screen.width - window.width, screen.height - window.height);
    shell.open();
    
    while (!shell.isDisposed)
    {
        if (!display.readAndDispatch())
        {
            display.sleep();
        }
    }
    
    display.dispose();
}

Replies:

    (some replies deleted)