[comp.sys.hp] Starbase Question

fkittred@bbn.com (Fletcher Kittredge) (06/06/89)

I would like to write a Starbase application which works on hp2393a,
hp2397a, hp2623a and hp2627a terminals.  This application needs to
have two screen regions: a graphics region and a scrolling dialog
region  The screen layout looks like this:

   -------------------------------------------
   |                                         |
   | Graphics Region                         |
   |                                         |
   |                                         |
   |                                         |
   |-----------------------------------------|
   | Scrolling Dialog Region                 |
   |                                         |
   -------------------------------------------

I have tried to set this up by calling gopen() on the device twice,
each time storing the file descriptors.  I then call set_p1_p2(),
view_port(), and view_window() on each of the file descriptors,
setting up two seperate windows, one with the coordinates of the
graphics region, and one with the coordinates of the scrolling region.
An outline of the code follows:

  if((graphics = gopen("/dev/screen/HP2397a", OUTDEV, "sox11",
                       INIT |RESET_DEVICE))
     == -1)
  ...
  if((scroll = gopen("/dev/screen/HP2397a", OUTDEV, "sox11",
                     INIT |RESET_DEVICE))
     == -1)
    {
  ...
  set_p1_p2(graphics, FRACTIONAL,  0.0, 0.5, 0.0, 1.0, 1.0, 0.0);
  view_port(graphics, ...);
  view_window(graphics, ...);
  ...
  set_p1_p2(scroll, FRACTIONAL,  0.0, 0.0, 0.0, 1.0, 0.5, 0.0);
  view_port(scroll,   ...);
  view_window(scroll, ...);
  ...
  while(some_condition)
     append_text(scroll,....);

I had hoped by setting up the two windows, I would get a scrolling
region in the bottom window.  However, text printed there does not
seem to scroll.  Is there any way to do this using Starbase?  In
general, Starbase text functions seem to be oriented towards labeling
axes, etc. Are there any set of Starbase text i/o methods for dealing
with applications which intermix graphics and text, similar to the C
stdio functions?

Does anyone out there know a solution to my problem?  In general, are
there any Starbase programming conventions on handling applications
which use both dialog and graphics?

thanks for any info,

regards,
fletcher



Fletcher E. Kittredge  fkittred@bbn.com

rjn@hpfcdc.HP.COM (Bob Niland) (06/07/89)

re: "I would like to write a Starbase application which works on hp2393a,
     hp2397a, hp2623a and hp2627a terminals.  This application needs to
     have two screen regions: a graphics region and a scrolling dialog
     region  The screen layout looks like this:"

>  -------------------------------------------
>  |                                         |
>  | Graphics Region                         |
>  |                                         |
>  |                                         |
>  |                                         |
>  |-----------------------------------------| <----set memory lock here
>  | Scrolling Dialog Region                 |
>  |                                         |
>  -------------------------------------------

I suggest implementing the scrolling dialog region by using text memory
lock.  If you set ML on a screen empty of text, new text written to the
ordinary tty port will scroll out of sight at the point indicated.

Regards,                                              Hewlett-Packard
Bob Niland      ARPA: rjn%hpfcrjn@hplabs.HP.COM       3404 East Harmony Road
                UUCP: [hplabs|hpfcse]!hpfcla!rjn      Ft Collins CO 80525-9599

llocp@rivm.UUCP (Charlos Potma) (06/07/89)

In article <40983@bbn.COM> fkittred@BBN.COM (Fletcher Kittredge)
writes:


> I would like to write a Starbase application which works on hp2393a,
> hp2397a, hp2623a and hp2627a terminals.  This application needs to
> have two screen regions: a graphics region and a scrolling dialog
> region 
> ...deleted...
> I have tried to set this up by calling gopen() on the device twice,
> each time storing the file descriptors.  I then call set_p1_p2(),
> view_port(), and view_window() on each of the file descriptors,
> setting up two seperate windows, one with the coordinates of the
> graphics region, and one with the coordinates of the scrolling region.
> ...deleted...

Perhaps an easy solution for mixing a graphics region and a
scrolling dialog region is to use starbase for the graphics
region and curses for the scrolling dialog region. The advantage 
of using curses (with normal writes) is of course portability
of this part of your application.
An important aspect of mixing graphics and alphanumeric
information in this way is to flush the starbase buffer at
the right moments by using make_picture_current.
Otherwise the graphics and alfa info could get "out of sync".


Charlos Potma
National Institute for Public Health and Environment
Laboratory for Air Research
mcvax!rivm!llocp

garys@hpfcmgw.HP.COM (Gary Stringham) (06/09/89)

> ...which works on hp2393a, hp2397a, hp2623a and hp2627a terminals....

> if((graphics = gopen("/dev/screen/HP2397a", OUTDEV, "sox11",
>                    INIT |RESET_DEVICE))

Are you talking to terminals?  If so, then you want open device
"/dev/tty" and driver "hp262x".  If you are on an X11 system, then thats
a different animal.  Just create one window for graphics and one for
text.

Assuming that you are talking to terminals, then you can use the memory
lock as Bob Niland suggested.  Move the cursor to the top of the screen,
clear the screen, then move the cursor to the spot on the terminal where
you want the dividing line to be and set memory lock, then move the
cursor to the bottom of the screen.  These can be done using standard HP
Terminal Escape Sequences.  Then only open one graphics window and use
set_p1_p2, view_port, etc, etc, to only address the top portion.  Then
using your standard graphics commands, send stuff to the graphics
window.  For the scrolling text stuff, just use your standard output
statements like you would use to send any text stuff to a terminal.  It
will scroll up to the dividing line and disappear.  When the program
exits, turn memory lock off so that the full screen will be in use.
Otherwise, the user will have to turn it off using the softkeys.

Gary Stringham