Page 1 of 1

GetPubScreens()

Posted: Tue Dec 18, 2012 10:24 pm
by djrikki
Hello,

I would like this command to be extended so I can find out a little bit more about the public screens that are open. In particular I'd like to be able to find how whether the screen is 32-bit etc so I can restrict Jack to only open on screens that match this criteria.

EDIT: Also being able to find out the Width and Height would also be invaluable. I realise I can find this out via GetAttribute(#DISPLAY, 0, #ATTRHOSTWIDTH), but this 'after' I've already promoted the application to the screen.

EDIT2: I don't believe that GetAttribute() and #HOSTWIDTH is even working correctly after performing a DebugPrint() of the current display on a public window. Its still reporting 1920 wide even though the screen is 1400.

Re: GetPubScreens()

Posted: Fri Dec 21, 2012 8:40 pm
by airsoftsoftwair
djrikki wrote:Hello,
I would like this command to be extended so I can find out a little bit more about the public screens that are open. In particular I'd like to be able to find how whether the screen is 32-bit etc so I can restrict Jack to only open on screens that match this criteria.

EDIT: Also being able to find out the Width and Height would also be invaluable. I realise I can find this out via GetAttribute(#DISPLAY, 0, #ATTRHOSTWIDTH), but this 'after' I've already promoted the application to the screen.
Makes sense. I'll add these features.
EDIT2: I don't believe that GetAttribute() and #HOSTWIDTH is even working correctly after performing a debugprint() of the current display on a public window. Its still reporting 1920 wide even though the screen is 1400.
I cannot reproduce this. Do you have a very small example script that shows this issue?

Re: GetPubScreens()

Posted: Thu Jul 19, 2018 5:50 pm
by r-tea
I need an example how the structure of the second GetPubScreen() returned table looks like. There's no example regarding that table.
I tried to read it like this:

Code: Select all

t,info = GetPubScreens()
For Local k=0 To ListItems(t)-1 Do DebugPrint(info[width], info[height], info[depth])
and I get output like this:

Code: Select all

Table: 0x272494d8 Table: 0x272494d8 Table: 0x272494d8
Table: 0x272494d8 Table: 0x272494d8 Table: 0x272494d8
There were two identical screens opened.
Why hex values? For what is the "Table:" prefix?

Re: GetPubScreens()

Posted: Fri Jul 20, 2018 7:12 am
by jPV
Those values are in subtables per screen element, and you're missing that "main" element.

Code: Select all

t,info = GetPubScreens()
; This does the trick:
For Local k=0 To ListItems(t)-1 Do DebugPrint(info[k]["width"], info[k]["height"], info[k]["depth"])
; Or optionally:
For Local k=0 To ListItems(t)-1 Do DebugPrint(info[k].width, info[k].height, info[k].depth) 

Re: GetPubScreens()

Posted: Fri Jul 20, 2018 7:54 pm
by r-tea
Thanks. It works as I expected. Worth to add it to Hollywood manual.