[misc.wanted] UNIX PC-GRAPHICS HELP!

dave@cooper.cooper.EDU (David Lew ) (12/10/87)

If there is any body out there that is versed in the UNIX-PC's graphics
capabilities, notably using VDI or UNIX-PC specific graphics, I gladly
appreciate your help.

My problem seems to lie in the invocation of track(3t).  I'm not able to read 
the incoming data relating the positions of the mouse buttons and where the 
cursor is on the screen.

Code follows:
------------------------

#include "types.h"
#include "stdio.h"
#include "tam.h"
#include "/usr/include/menu.h"
#include "/usr/include/track.h"
#include "/usr/include/sys/window.h"
#include "/usr/include/kcodes.h"

int cmdop,track(),w,op,*butptr,*whyptr;
char str[100];
track_t *trk;

tkitem_t iconitems[]=
{
     0,0,1600,2800,0,1,
     0,2800,1600,2800,0,2,
     0,0,0,0,0,0
};

track_t start=
{
     MSDOWN,
     1,
     1,
     0,
     0,
     0,
     0,
     iconitems,
     iconitems,
     0
};

main()
{
     v_opnwk(...setup...);

     cmdop=T_BEGIN | T_INPUT;
     track(devhandle,&start,cmdop,butptr,whyptr);
     for(;;)
     {
          sprintf(str,"%d:%d",*butptr,*whyptr);
          v_gtext(devhandle,10000,8000,str);
     }
}
--------------
Now, while it's in the for loop, it's supposed to display the data pointed to
by butptr and whyptr.  They represent the positions of the mouse buttons when
invoked by track(3t).  Track's supposed to return data only upon certain
conditions.  If a button is pressed or if the mouse enters a certain defined
area, track returns the data at butptr and whyptr.  However, I can't seem to be
able to do this.  Any ideas?  Please reply ASAP if you have any CLUE!  Thx.


 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
 <>                                                                          <>
 <>   Yo:David Lew                                                           <>
 <>   At:The Cooper Union for        ihnp4!philabs!phri!cooper!dave          <>
 <>      the Advancement of                       ||                         <>
 <>      Science and Art               "phri!cooper!dave"@nyu.arpa           <>
 <>                                                                          <>
 <>"Don't push me cuz I'm close to the edge, I'm trying not to lose my head."<>
 <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>

pjc@pbhyf.UUCP (Paul Condie) (12/16/87)

In article <1154@cooper.cooper.EDU> dave@cooper.cooper.EDU (David Lew ) writes:
>
>If there is any body out there that is versed in the UNIX-PC's graphics
>capabilities, notably using VDI or UNIX-PC specific graphics, I gladly
>appreciate your help.
>
>My problem seems to lie in the invocation of track(3t).  I'm not able to read 
>the incoming data relating the positions of the mouse buttons and where the 
>cursor is on the screen.
>
>Code follows:
>------------------------
>
>#include "types.h"
>#include "stdio.h"
>#include "tam.h"
>#include "/usr/include/menu.h"
>#include "/usr/include/track.h"
>#include "/usr/include/sys/window.h"
>#include "/usr/include/kcodes.h"
>
>int cmdop,track(),w,op,*butptr,*whyptr;
>char str[100];
>track_t *trk;
>
>tkitem_t iconitems[]=
>{
>     0,0,1600,2800,0,1,
>     0,2800,1600,2800,0,2,
>     0,0,0,0,0,0
>};

Your rectangle is too large (1600, 2800 etc) in pixels.
You need to find out how big your window is ( i use windy -r, ioctl will also
work) and make sure your rectangles don't exceed it.  Track will not work
if any of your rectangles go outside your window.  For a full screen window
the width is 720 height is 248 or something like that.