help needed with BOOPSI

help needed with BOOPSI

Post by Daniel T Cantre » Wed, 10 Mar 1993 09:45:37



I need some help trying to find out the reason why my program wont
do what I am trying to get it to do.  Also, I have a more general question
dealing with BOOPSI.

The particular objective is to have a button on the 'ArmorWindow' window,
that when pressed will change the text for the button that is displayed
on it.  I am trying to make a BOOPSI button give me a similar use as the
gadtools cycle gadget.

Specifically, I want the button to start with the text "front", and every
time it is pressed, I try to switch between "front" and "back".  The program
doesn't do that however.  When I run the program, the first time the button
is pressed it thinks that gad->UserData is 0 and tries to set the text to
"front".  From that point on, it seems to be continually in the opposite
state than it should be. (stepped through it using codeprobe).  

The setup I am using is an A1200 with 4megs FAST ram and SAS/C 6.2 and the
code is included below.

The general question I have is if there is compatability between gadtools
(or normal gadgets) and BOOPSI objects.  The big question is how to deallocate
objects and gadgets if they are in random order in the linked list of gadgets
for the window.  Would there be some way to just proceed through the linked
list and determine by that info alone if the gadget is from gadtools or from
BOOPSI?

Thanks... any help will be appreciated.

Dan Cantrell

// code follows

/*  function segment that sets up the gadget I want to use  */

        frImage = NewObject(NULL, "frameiclass",
                        IA_Width,                       60L,
                        IA_Height,                      20L,
                        TAG_END);

        aobjs = pgad = (struct Gadget *)NewObject(NULL, "frbuttonclass",
                        GA_Left,                                100L,
                        GA_Top,                         100L,
                        GA_ID,                          LTARMORBUT_ID,
                        GA_Image,                       frImage,
                        GA_Text,                                "Front",
                        GA_RelVerify,           TRUE,
                        GA_UserData,            1L,
                        TAG_END);

/*  main loop for the program  */

                Wait ( 1L << MyPort->mp_SigBit );
                while ( message = (struct IntuiMessage *) GT_GetIMsg(MyPort) )
                {       class = message->Class;
                        code = message->Code;
                        switch (class)
                        {       case GADGETUP:
                                        gad = (struct Gadget *) message->IAddress;
                                        switch ( gad->GadgetID )
                                        {       case LTARMORBUT_ID:
                                                        if ( gad->UserData )  /* front */
                                                        {       success = SetGadgetAttrs(gad, ArmorWindow, NULL,
                                                                                GA_Text, "Back", GA_UserData, 0L, TAG_END);
                                                                RefreshGList(gad, ArmorWindow, NULL, 1);  }
                                                        else
                                                        {       success = SetGadgetAttrs(gad, ArmorWindow, NULL,
                                                                                GA_Text, "Front", GA_UserData, 1L, TAG_END);
                                                                RefreshGList(gad, ArmorWindow, NULL, 1);  }
                                                        break;
                                        }
                                        break;
                        }
                        GT_ReplyIMsg(message);
                }

 
 
 

help needed with BOOPSI

Post by Doug Kell » Thu, 11 Mar 1993 07:26:57




>Subject: help needed with BOOPSI

>The general question I have is if there is compatability between gadtools
>(or normal gadgets) and BOOPSI objects.  The big question is how to deallocate
>objects and gadgets if they are in random order in the linked list of gadgets
>for the window.  Would there be some way to just proceed through the linked
>list and determine by that info alone if the gadget is from gadtools or from
>BOOPSI?

Just keep two different lists, one for gadtools gadgets and one for
boopsi gadgets.  Then you can remove and deallocate the list separately.

--
Doug Keller


 
 
 

1. Need Help with Gadtools and BOOPSI Gadgets

Help, I am currently using Gadtools and BOOPSI to get a string
object placed on a window on the workbench screen.  I have no
problems getting the gadget to open up under BOOPSI or Gadtools.

However, when using GadTools is there a way to open a STRING_KIND
Gadget with a GA_RelWidth setting.  This way the Width of the
Gadget could remain relative to the width of the Window.  So far,
I have been unsucessful.  
    ex.
         gad = CreateGadget(STRING_KIND,gad,&ng,
                  GA_RelWidth, -20,
                   TAG_DONE);

  or something to this effect, that would allow the gadget to set
up its flags and width field.  Should I just use the pointer to the
gadget and modify the fields myself?

I tried using BOOPSI to get the "strgclass" object set,
so that I could use this as a string gadget in place of the GadTools
gadget ( I really need RELWIDTH).  I was able to open the NewObject
fine but when I tried to create an Image Structure for the Gadget
(i.e. Border such as supported by the GadTools STRING_KIND gadget)
I got a wierd looking box that in no way was the size of my gadget.

What I would like is examples of STRING_KIND and "strgclass" Gadtools
and BOOPSI gadgets, so that I may figure out what I am doing wrong.

Thanks,

--


            ///                  Recursion:     Thinking
        \\\///    University of Texas                 about
         \\//   Amiga Computers                     Thinking

2. SVP AIDEZ MOI !!!! MERCI !!!!

3. I need help with BOOPSI

4. ANN: REVIEW: Cropped Out

5. Need help with programming a BOOPSI-prop-gadget

6. IE 5.5 released for download

7. Help on Boopsi needed

8. I4004 system

9. BOOPSI Source needed.

10. Need Boopsi two-state push-button

11. DejaVu help needed ... help needed

12. Help with BOOPSI

13. BOOPSI gadget help request