Path: utzoo!attcan!uunet!super!udel!princeton!njin!rutgers!mailrus!utah-gr!uplherc!sp7040!obie!wsccs!val From: val@wsccs.UUCP (Val Kartchner) Newsgroups: comp.sys.amiga Subject: Gadgets Keywords: gadgets,amiga,help Message-ID: <647@wsccs.UUCP> Date: 14 Sep 88 18:28:54 GMT Lines: 112 I'm having a problem with some gadgets on the Amiga. Here are the structure declarations: ----------------------------------------------------------------------------- /* Window and screen stuff */ #define SCREEN_WIDTH 640 #ifndef STDSCREENHEIGHT #define STDSCREENHEIGHT 400 #endif /* Colors */ #define BACKGROUND 0 #define NORMAL 1 #define HIGHLIGHT 2 #define GHOSTED 3 #define BORDER NORMAL #define TEXT NORMAL /* Text stuff */ #define TEXT_LEFT 5 #define TEXT_HEIGHT 8 #define TEXT_WIDTH 8 unsigned short larrow_bitmap[] = { 0x0000, 0x1000, 0x3000, 0x7e00, 0xfe00, 0x7e00, 0x3000, 0x1000 }; unsigned short rarrow_bitmap[] = { 0x0000, 0x0800, 0x0c00, 0x7e00, 0x7f00, 0x7e00, 0x0c00, 0x0800 }; struct Image larrow_image = { 0,0, 8,8,1, larrow_bitmap,0x2,0x0,NULL }; struct Image larrow_comp = { 0,0, 8,8,1, larrow_bitmap,0x1,0x0,NULL }; struct Image rarrow_image = { 0,0, 8,8,1, rarrow_bitmap,0x2,0x0,NULL }; struct Image rarrow_comp = { 0,0, 8,8,1, rarrow_bitmap,0x1,0x0,NULL }; struct PropInfo volpropinfo = { AUTOKNOB | FREEHORIZ, 1,1, 0xffff/10,0xffff/10, 0,0,0,0,0,0 /* Intuition inits these */ }; char GadgBName[11],GadgBVolume_I[4]="1"; struct Gadget GadgVolume_RA = { NULL, TEXT_LEFT+48*TEXT_WIDTH,15-TEXT_HEIGHT+1,TEXT_WIDTH*1,TEXT_HEIGHT, GADGIMAGE | GADGHIMAGE,GADGIMMEDIATE,BOOLGADGET, (APTR)&rarrow_image,(APTR)&rarrow_comp,NULL,NULL, NULL, NULL,NULL /* User Info */ }; struct Gadget GadgVolume_P = { &GadgVolume_RA, TEXT_LEFT+35*TEXT_WIDTH,15-TEXT_HEIGHT+1,100,TEXT_HEIGHT, GADGHNONE,RELVERIFY,PROPGADGET, NULL,NULL,NULL,NULL, (APTR)&volpropinfo, NULL,NULL }; struct Gadget GadgVolume_LA = { &GadgVolume_P, TEXT_LEFT+34*TEXT_WIDTH,15-TEXT_HEIGHT+1,TEXT_WIDTH*1,TEXT_HEIGHT, GADGIMAGE | GADGHIMAGE,GADGIMMEDIATE,BOOLGADGET, (APTR)&larrow_image,(APTR)&larrow_comp,NULL,NULL, NULL, NULL,NULL /* User Info */ }; ----------------------------------------------------------------------------- I have other gadget declarations also. When I compile this with Lattice (and link it), it crashes immediately. If I remove GadgVolume_P from the list, all of the gadgets work correctly except GadgVolume_LA and GadgVolume_RA which don't complement. I've tried GADGHCOMP and alternate images, and they still don't change, but I do recieve GADGETDOWN events. When I do an AddGadget(w,&GadgVolume_P,-1) [Where w is a (Window *)], the machine immediately crashes with Address Error, Illegal Instruction, 1010 opcode, or 1111 opcode. When I compile it with the latest version of Manx Aztec C (and link it), *NONE* of the gadgets even show up. (Fastmem was turned off.) Once it recieves a left mouse button event, even the menus stop working. I'm using midi.library, and all of the libraries have been opened successfully. Would someone please help me with this? Thanks in advance, -=:[ VAL ]:=- -- ---- /\ ---------------------------------------------------------------- /\/\ . /\ | Val Kartchner {UT@WSC} | 'vi' must go, this / \/ \/\/ \ | #include | is non-negotiable. ===/ U i n T e c h \===!ihnp4!utah-cs!utah-gr!uplherc!sp7040!obie!val=====