HP Forums

Full Version: which grob?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the following program

export spin ()
begin
Rect_P (); <--- who does this clear.?
CHOOSE (...); <--- where does this draw
TEXTOUT_P("hello",0,0); <-- where does this draw
while 1 do end;
end;

What grob am i writing to.?

if i break out i return to the starting screen.
The choose box opens on top of the starting screen which is untouched.

What exactly is the graphics paradigm here?
Rect_P() clears G0
Choose() does not store anything to a GROB it only displays a menu
TextOut_P("hello",0,0) outputs hello at 0,0 on G0

Experiment! if you don't know test it out Smile
(11-16-2015 10:46 PM)ji3m Wrote: [ -> ]In the following program

export spin ()
begin
Rect_P (); <--- who does this clear.?
CHOOSE (...); <--- where does this draw
TEXTOUT_P("hello",0,0); <-- where does this draw
while 1 do end;
end;

What grob am i writing to.?

if i break out i return to the starting screen.
The choose box opens on top of the starting screen which is untouched.

What exactly is the graphics paradigm here?

Type: RECT_P and with the cursor somewhere in that command name, press the help key for all the information on that command. But to answer your question, when no graphics object is specified, the default G0 (current display) is always used.
Are the home screen and the cas screen grobs?
if so what number?

I certaintly have looked at the help screens but ...
(11-17-2015 12:57 AM)ji3m Wrote: [ -> ]Are the home screen and the cas screen grobs?
if so what number?

I certaintly have looked at the help screens but ...

G0 is the "current" display, so it could be the home or cas, depending where you are.
Hello,

G0 is the 'desktop', it is the current display framebuffer...
G0 is the default graphic for all graphical operations (if none is specified)...

Choose will of course display on the desktop, BUT since Choose is a 'window' control, executing it will cause a display of the whole desktop (not only the Choose), so any drawing that you might have done BEFORE doing the choose on G0 will be erased at this point...

Please note the Freeze command, which can freeze the display after the end of the execution of a program until a key is pressed.

Cyrille
Reference URL's