CompuServe Thread

#Public Screens

8 messages in this thread
#37834From: ShraddhanNov 20, 1993 6:07 PM
Re: Public Screens Can someone give me a brief run-down of how to open a public screen? The docs seem to be inconsistent/illogical about this. The RKM/Libraries on page 53 says that I should declare a screen public in the OpenScreenTagList() call by specifying a public name string with the SA_PublicName tag. However, if I do this, the screen's font becomes the same as Workbench's, but if I omit the tag, the screen font is OK. The RKM goes on to say that: "when a new public screen is opened, it starts out private… Use the PubScreenStatus() function to make the screen public…" But the docs for this function only define the one flag value, PSNF_PRIVATE, and the text only talks about making the screen private, not public. The function call PubScreenStatus(screen, 0L) returns the value 1 – and the docs don't say what this means, only saying that a return value of 0 indicates a failure to make the screen private. Regards, Shraddhan (via AP from Hertfordshire, England)
#37845From: Steve TibbettNov 21, 1993 8:31 AM
How to open a public screen: struct Screen *Pub=OpenScreenTags(0, SA_PubName, "MyPubScreen", TAG_DONE); PubScreenStatus(Pub, 0); /* Use the screen… */ PubScreenStatus(Pub, PSNF_PRIVATE); while (CloseScreen(Pub)==0) Delay(25); Read over that carefully – there are three things here you need to remember when dealing with public screens: 1) They open in PRIVATE mode so you have to call PubScreenStatus to make it into a publicly available screen 2) You have to take it private again before you start trying to close it. 3) CloseScreen() may fail. This will happen if there is a visitor window on your public screen. The program that opens the screen is responsible for closing it, or so I've heard folks at Commodore say. Me, I think the last program out should be responsible for closing the screen… …Steve
#37858From: Arnie CachelinNov 22, 1993 3:40 PM
If the program taht opened the screen waits for the screen to be closed sucessfully before it exits, as it SHOULD, then it will always be the last one out, and thus responsible for closing the screen.
#37871From: Steve TibbettNov 23, 1993 7:13 AM
Yes, Arnie, but the problem I have is this: My bulletin board, BBX, can open on a public screen. If the screen isn't open, BBX will create it. BBX will not exit without closing the screen. So if you run BBX node 1, then node 2, then quit node 1, node 1 is going to hang around in memory forever trying to close that screen. If it had been written from the start that "Last one out turns out the lights" then I wouldn't have to worry about this, but as it is, I can't just assume the other BBX node will close it because if a visitor window is present when the second BBX node is closed, the screen will never close.
#37891From: ShraddhanNov 24, 1993 6:19 PM
> Last one turns out the lights… Why not start a separate process to just open the screen, and close it as soon as it is no longer required? You wouldn't then have the overhead of a large program stuck in memory waiting merely so it can close a screen. Regards, Shraddhan (via AP from Hertfordshire, England)
#37966From: Arnie CachelinNov 29, 1993 2:09 PM
I guess you have to 'poll' with CloseScreen, to keep trying 'til it succeeds. Free up everything else first!, or keep track of visitor windows and do something like you get when trying to quit workbench: "Sorry, I can't quit, there are currently 7.4 visitor windows on the screen I opened."
#37882From: ShraddhanNov 24, 1993 12:26 AM
Thanks for the help with public screens. I've got my screen & window(s) opening OK now.
#37884From: John GagerNov 24, 1993 1:37 AM
Well here's a ghost from the past <g>. Welcome back Steve! Hope you get the chance to stay for awhile and become a regular CIS junkie. // \X/ John – (TechnoJunkie at heart)