uzun@wolf.UUCP (Roger Uzun) (01/14/88)
I am trying to add scroll bars to a SuperBitmap Window that opens up fine otherwise. All I get are Gurus when I add the ptr to the linked list of Gadgets with my 2 Proportional Gadgets (scrollbars) in it. All I am doing currently is initializing the following data structures and Opening the window as normal with its gadgetlist ptr pointing to my myGadgetList as detailed below. Structures I use: struct PropInfo HScrollBar = { FREEHORIZ | AUOTKNOB, 0,0, 0XFFFF,0XFFFF, 0,0,0,0,0,0}; {..LIKEWISE EXCEPT WITH FREEVERT FOR VScrollBar .. }; struct Gadget myGadgetList[] = { {&myGadgetList[1], 0,0,1024,10, /* size of super bitmap is 1024 wide */ GADGHNONE | GADGBORDER | GRELBOTTOM, BOTTOMBORDER | RELVERIFY | GADGIMMEDIATE, PROPGADGET, NULL, NULL, NULL, 0X0, (APTR)&HScrollBar, 1, NULL}, {...Basically same for Vertical bar..}; Any ideas on what I am doing wrong? I imagine I am not initializing a necessary structure or something. Any help would be greatly appreciated. Thanks -Roger BOTTOMBORDER |
uzun@wolf.UUCP (Roger Uzun) (01/14/88)
The problem seems to have been with a pointer to the Border Structure in the entries of the GadgetList, This cannot be NULL. So I am having it point to a border structure but I do not know how to initialize this array of WORD Vectors. I just want "Normal" Scroll bars. Anyways, it does not GURU anymore it just refuses to open the window. Anyone know how I can initialize the Border structure and its vectors for ScrollBars? Am I missing something else? (besides stuff to respond to the gadget events and scroll the window). Thanks in advance -Roger
dpvc@ur-tut.UUCP (Davide P. Cervone) (01/20/88)
In article <617@wolf.UUCP> uzun@wolf.UUCP (Roger Uzun) writes: > Anyone know how >I can initialize the Border structure and its vectors for >ScrollBars? Am I missing something else? (besides stuff to >respond to the gadget events and scroll the window). Scroll bars that have AUTOKNOBs must have their GadgetRender field point to an Image structure. Intuition initializes and maintains this structure itself, as I recal, so you won't have to do anything but allocate space for it and link it into your gadget. Each scroll bar needs to have its own. I believe that intuition uses this structure to make the rectangular knob (its width and height seem to indicate this). Hope this helps. >Thanks in advance Your welcome >-Roger Davide P. Cervone dpvc@tut.cc.rochester.edu
peter@sugar.UUCP (Peter da Silva) (01/29/88)
In article <616@wolf.UUCP>, uzun@wolf.UUCP (Roger Uzun) writes: > I am trying to add scroll bars to a SuperBitmap Window that opens up > fine otherwise. All I get are Gurus when I add the ptr to the linked > list of Gadgets with my 2 Proportional Gadgets (scrollbars) in it. > struct PropInfo HScrollBar = { > FREEHORIZ | AUOTKNOB, > 0,0, > 0XFFFF,0XFFFF, > 0,0,0,0,0,0}; You need to provide an uninitialised Image structure for the scrollbar. Why, I don't know. It seems it should be able to say "ah, it's null, so I'll allocate the Image structure along with the bitmap". One of the great mysteries of the modern world, I guess... but there it is. Perhaps 1.4 can be a bit smarter in that area. -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- Disclaimer: These U aren't mere opinions... these are *values*.