#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
#include <intuition/gadgetclass.h>
#include <proto/gadtools.h>
struct Screen *src;
void GT_configure( struct NewGadget *ng,int id,int x,int y,int w,int h)
{
bzero(ng,sizeof(struct NewGadget));
ng -> ng_LeftEdge = x;
ng -> ng_TopEdge = y;
ng -> ng_Width = w;
ng -> ng_Height = h;
ng -> ng_GadgetID = id;
ng -> ng_VisualInfo = GetVisualInfo(src, TAG_DONE );
ng -> ng_TextAttr = 0;
ng -> ng_Flags = 0;
}
int main()
{
struct NewGadget ng;
struct Window *win;
void *head = NULL;
void *next = NULL;
src = LockPubScreen(NULL);
win = OpenWindowTags (NULL,
WA_Title,NULL,
WA_Left, 0,
WA_Top, 0,
WA_Width, 200,
WA_Height, 200,
WA_Flags, 0,
WA_IDCMP,
IDCMP_MOUSEMOVE | IDCMP_CLOSEWINDOW | IDCMP_MOUSEBUTTONS |
IDCMP_GADGETUP | IDCMP_GADGETDOWN,
TAG_END);
GT_configure( &ng,2000,1,1,20,200);
next = CreateContext( (void *) &head );
next = CreateGadget(SCROLLER_KIND, next, &ng,
GTSC_Top, 0,
GTSC_Total, 1070,
GTSC_Visible, 1020,
GTSC_Arrows, 13,
GACT_IMMEDIATE, TRUE,
GACT_RELVERIFY, TRUE,
PGA_Freedom, 0,
TAG_DONE);
CloseWindow(win);
UnlockPubScreen(NULL,src);
}
Edited by LiveForIt on 2011/12/12 16:11:27