GUI/Maximum window dimensions: Difference between revisions

J
(Changed lang tag to Java to enable code highlights)
(J)
Line 563:
Output: Maximum drawing area values: width is 1280 and height is 749.
</lang>
 
=={{header|J}}==
 
For this task, we can create a temporary window, and subtract its usable area from its size. This gives us the size (in pixels) used for decorations. Then we can query the screen size and subtract the size of those decorations.
 
For example:
 
<lang J> (".wd 'qscreen') -&(2 3&{) (wd'pclose') ]-/".'qform',:&wd 'pc a closeok; cc g isidraw; pshow; qchildxywh g'
1348 750</lang>
 
Here, we had a screen with 1366 by 768 pixels (width and height), and space for decorations subtract 18 from each of those dimensions.
 
=={{header|Java}}==
6,962

edits