There are several procedures in the Poplog+X package that need
a SCREENPTR, such as
XWidthOfScreen(SCREENPTR) -> INT [procedure]
XHeightOfScreen(SCREENPTR) -> INT [procedure]
XWidthMMOfScreen(SCREENPTR) -> INT [procedure]
XHeightMMOfScreen(SCREENPTR) -> INT [procedure]
etc.
See REF XT_LIBS
I found it extraordinarily difficult to find out how to get hold of
a SCREENPTR, but eventually came up with this hack:
-----------------------------------------------------------------------
uses xlib;
uses xpt_screeninfo;
;;; This holds the default screenptr
lvars screenptr = false;
define active default_screen_ptr() -> ptr;
;;; guaranteed to return a reasonable SCREENPTR
lvars ptr;
if screenptr then
screenptr -> ptr
else
XptDefaultSetup();
XtScreen($-propsheet_utils$-create_shell()) ->> ptr
-> screenptr
endif;
enddefine;
-----------------------------------------------------------------------
The active variable default_screen_ptr can be used as argument to the
above procedures (if you are dealing with only one screen). If anyone
has found a better solution, please let me know. This one works from
pop11, but not from basepop11, as it uses a propsheet utility.
Thanks.
Aaron
|