CompuServe Thread

#gadgets

9 messages in this thread
#29460From: Steven ParkOct 21, 1992 8:48 PM
I would like to add a gadget to the window and then remove it when no longer needed. Do I have to struggle with AddGadget to do this? Would it be easier to make a small requester that looks like a gadget?/exit
#29462From: Steve AhlstromOct 21, 1992 10:02 PM
Creating a requester is a lot more work than a gadget. Simply AddGadget() then RemoveGadget() when done.
#29472From: Steven ParkOct 22, 1992 12:17 AM
I tried that but it crashed, thought maybe that wasn't its purpose. Will have to check the code over carefully. Thanks Steve.
#29479From: Steve AhlstromOct 22, 1992 2:50 AM
If you're adding a gadget in when there are other gadgets present, you have to be real careful of how you remove the gadget and relink the gadget list. It's a fairly simple operation, but if you aren't real careful, you'll visit the turbuned one a lot!
#29508From: Steven ParkOct 22, 1992 9:24 PM
Yah, been doing that a lot. Decided to just leave it in there. Is there a way to cycle the colors of a BOOL gadget on each select?
#29528From: Steve AhlstromOct 23, 1992 12:12 PM
Steven, I'm not really sure what you're asking. A BOOL gadget, by definition, is either ON or OFF. When you click on it, it becomes ON (or TRUE) and you take some action. When you release the click (depending on how you set GADIMMEDIATE and RELVERIFY, of course) it is no longer true (and your program may or may not take some action in reference to its non-TRUE state). From your question, it seems to me that what you really want to use is a (2.0) CYCLE_KIND gadget or possibly a CHECKBOX_KIND gadget. -sja
#29542From: Steven ParkOct 23, 1992 7:10 PM
I need the autodoc to use CYCLE_KIND. I'm using SAS5.10a which has 2.0 header files but if it has the autodocs for the new features, I can't find them. What I'm trying to do is cycle between four colors as an indication of what mode has been picked. What changes color doesn't matter. There is an Image in the window which would be a good thing to change the color of but I don't want to get into graphic primitives. Instead I've set up four Images exactly the same except for color, then turn them on or off with AddGadget ect. This is a pain and there's gotta be a better way. Any ideas?
#29614From: Vic WagnerOct 25, 1992 7:13 PM
Steven, I just modified an old standby test program of mine "swindow.c" and have uploaded it to library 5 here in AmigaTech. It will be public around 11PM PST tonight. The program does several things and now 'cycles' the colors of two BOOL gadgets through the 4 colors on the WB each time the window in which they are is 'ACTIVATED'. I hope this is of some use to you. Oh, the relevant lines are 457&458 (not a LOT of work needs doing smmiiille>).
#29622From: Steven ParkOct 25, 1992 8:58 PM
Thanks a lot for your help, Vic. \exit