Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ICAEN.UIOWA.EDU!dbfunk From: dbfunk@ICAEN.UIOWA.EDU (David B. Funk) Newsgroups: comp.sys.apollo Subject: Re: David Letterman's top ten list of Apollo questions. Message-ID: <8902230817.AA00385@icaen.uiowa.edu> Date: 23 Feb 89 07:15:41 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: Iowa Computer Aided Engineering Network, University of Iowa Lines: 67 Re posting <15210@vlsisj.VLSI.COM>: > 1) Create a window from a 'C' program that can NOT be resized > by the user? I have a window that must be a fixed size, but > currently the user can "grow" it and things get messed up. There's no way that I know to prevent a user from trying to resize a window, but you can prevent them from succeeding. Write a gpr refresh routine that will check the window size & location when called, and if the window is not where you want it, put it back. The net effect will be: the user grabs the window, stretches it, but when they let go, it will snap back to its starting location. (I'm assuming that you're using GPR direct mode graphics) > 2) Create a window whose size includes the legend and border? Create the window, then turn the border off, you'll get the whole window to use then. If you want a border, draw it your self. The different window border sizes are caused by the legend fonts sizes. You could find out what kind of legend font the machine was using, read it, and then subtract its parameters from your window size if you want to keep the DM legend. > Access the node id with a 'C' procedure? There are lots of different system calls that have the node ID as part of the info returned. Any UID created on the node will have the node ID as the bottom 20 bits. Most kinds of process info calls will give you a process UID, easiest is proc2_$who_am_i. > 4) Place cursor on a named window using the Display Manager (DM)? That's not easy. If you first turn it into an icon, when you un-icon it, the cursor will usually end up on it. Lots of work. > 5) Determine the contents of the DM search buffer, preferably using > DM commands. Or, how about from a shell script. I don't know that there is a way to do that. The search buffer is internal to the DM. > 6) Query (all DM) windows info from 'C' program? Read the contents of the "all_group" paste buffer. Try the following: "cat `node_data/paste_buffers/all_group" This will give you the names of all windows & icons on the screen. > 7) Get a the name of the process a 'C' program or shell script is > running in from that program or shell script? Get the parent process ID (getppid), capture the output from a "ps -agN" and grab the first 32 characters from the line with the matching PID. (this will work at sr9.7 or sr10) > 8) Use the DM mark stack to do anything useful? i.e. How in heck > does that #!&$% mark stack work? Check out some of the key defs in "/domain_examples/keydefs", EG "/domain_examples/keydefs/full/kd" > 9) Get the parameters (baseline, line height, etc) for a fixed pitch font? > The method I use now is show below. It seems to work for f5x9 but not for > f9x15. Read the font file header, all the answers are in there. For a pre-sr10 font file, see the insert file /sys/ins/smdu.ins.* for the interpetation. For a sr10 font file, use or /sys/ins/fontn.ins.*