How can I move PtTrend in a vertical direction? Pt_TREND_VERTICAL flag do
not help me…
// LH PtTrend Test
//
#include <Pt.h>
#include <Ph.h>
#include <Ap.h>
int timer_cb( PtWidget_t *, void *,PtCallbackInfo_t *);
int count_draw_s = 0;
PtWidget_t *pttrend_widget;
int main( int argc, char *argv[] )
{
PtWidget_t *window;
PhArea_t area;
PtArg_t args[10];
PtWidget_t *timer_widget;
if ((window = PtAppInit(NULL, &argc, argv, 0, NULL)) == NULL)
exit(1);
area.size.w = area.size.h = 500;
PtSetArg( &args[0], Pt_ARG_AREA, &area, 0 );
PtSetArg( &args[1], Pt_ARG_TREND_FLAGS, Pt_TREND_VERTICAL | Pt_GRID,
Pt_TREND_VERTICAL | Pt_GRID );
pttrend_widget = PtCreateWidget( PtTrend, window, 2, args );
// Timer Widget
PtSetArg( &args[0], Pt_ARG_TIMER_INITIAL, 10, 0);
PtSetArg( &args[1], Pt_ARG_TIMER_REPEAT, 10, 0 );
timer_widget = PtCreateWidget(PtTimer, window, 2, args);
PtAddCallback(timer_widget, Pt_CB_TIMER_ACTIVATE, &timer_cb, NULL );
PtRealizeWidget(window);
PtMainLoop();
return (EXIT_SUCCESS);
}
int timer_cb( PtWidget_t *widget, void *apinfo, PtCallbackInfo_t *cbinfo )
{
short value;
PtArg_t args[1];
/* eliminate ‘unreferenced’ warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
value = count_draw_s++;
PtSetArg( &args[0], Pt_ARG_TREND_DATA, &value, 1 );
PtSetResources( pttrend_widget, 1, &args[0] );
return( Pt_CONTINUE );
}