Welcome, Guest. Please login or register.

Author Topic: Reaction, adding/removing Gadgets from Windows  (Read 2829 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Reaction, adding/removing Gadgets from Windows
« on: July 01, 2003, 02:01:59 AM »
I'm using the Reactor GUI builder,and I can get it to sucessfully open a window. How can I remove/add my gadget list to that window? If I use AddGList() or RemoveGList(), it doesnt affect the display at all.. I can get it to use my GUI using the "WINDOW_Layout" setting in Reactor, however, I want to be able to have multiple gadget lists, and be able to change it at various times.

Heres the relevant parts of my code (bits and pieces).. ATM I'm attempting to use SetAttrs() to set the gadget list for my Window..

Object *GlbWindowP;
struct Window *GlbIWindowP;
struct Gadget **GlbGadgetsP;

if(GlbWindowP = RL_NewObject(GlbResourceP,WIN_1_ID,
                                WINDOW_SharedPort,GlbIDCMPortP,
                                WINDOW_AppPort,GlbAppPortP,
                                TAG_END)) {

GlbGadgetsP = (struct Gadget **) RL_GetObjectArray(GlbResourceP,GlbWindowP,GROUP_2_ID);

SetAttrs(GlbWindowP, WINDOW_Layout, *GlbGadgetsP);

DoMethod(GlbWindowP,WM_OPEN);

}


And heres how I was using AddGList and RemoveGList originally.. Just to clarify, when using these functions, it will not add or remove my gadgets.. when the window opens it is empty.

AddGList((struct Window*)GlbWindowP, *GlbGadgetsP, -1, -1, NULL);
//RemoveGList((struct Window*)GlbWindowP, *GlbGadgetsP, -1);
RefreshGList(*GlbGadgetsP,(struct Window*)GlbWindowP, NULL, -1);

 

Offline uncharted

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1520
    • Show only replies by uncharted
Re: Reaction, adding/removing Gadgets from Windows
« Reply #1 on: July 01, 2003, 02:37:03 AM »
Hey there.

I started learning ReAction a while back.  I found it easier to dump ReActor and code the GUI by hand, there are some good examples in the NDK that you can use, and there are plenty of macros to make the code cleaner.  

I tend to use Reactor just for prototyping interfaces before I code them, it's just too buggy for much else.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #2 on: July 01, 2003, 02:56:54 AM »
I've been going over the NDK examples,but I cant work out how to do GUI's by hand.. I suck. :/
 

Offline uncharted

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1520
    • Show only replies by uncharted
Re: Reaction, adding/removing Gadgets from Windows
« Reply #3 on: July 01, 2003, 03:19:46 AM »
What in particular are you stuck on? Which examples have you looked at?
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #4 on: July 01, 2003, 03:26:28 AM »
The 3.9 NDK Listbrowser example.. I couldnt get a string gadget and a listbrowser to not overlap each other.. then I tried some reaction examples off aminet.. and RA_OpenWindow() didnt like the arguments I was passing to it.. a window object. Tried casting it as gadget* window* object* .. it still wouldnt compile, said illegal argument. Sigh.

Surely theres a way to get the Reactor stuff to work.
 

Offline uncharted

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1520
    • Show only replies by uncharted
Re: Reaction, adding/removing Gadgets from Windows
« Reply #5 on: July 01, 2003, 03:40:29 AM »
Quote

jahc wrote:
The 3.9 NDK Listbrowser example.. I couldnt get a string gadget and a listbrowser to not overlap each other.. then I tried some reaction examples off aminet.. and RA_OpenWindow() didnt like the arguments I was passing to it.. a window object. Tried casting it as gadget* window* object* .. it still wouldnt compile, said illegal argument. Sigh.

Surely theres a way to get the Reactor stuff to work.


Ah, there is your problem.  The listbrowser example is only an example of a single ReAction gadget within a ordinary window NOT a complete GUI layout.  The listbrowser example is actually quite different from the others.

Look at the checkbox example, you should be able to see how it all fits together you start with the main layout class and then add everything else.  The example is very clear and easy to follow. (even I got it ;-) )

If you still have problems PM me and I'll be happy to help you via email.
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #6 on: July 01, 2003, 04:12:04 AM »
Okay, I've got it semi working now. I decided to try again to make the GUI by hand. I'm using a layout gadget... when I tried this before, it got stuck on RA_OpenWindow() .. I'm not getting these problems anymore. Maybe because I had to cast the Window object when creating it, and I cast it as the wrong type? I dont know, but it seems to be working now. I'm able to use SetAttrs() now as well it seems. Thanks for the push. :)
 

Offline uncharted

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1520
    • Show only replies by uncharted
Re: Reaction, adding/removing Gadgets from Windows
« Reply #7 on: July 01, 2003, 07:07:58 PM »
Quote

jahc wrote:

Thanks for the push. :)


No problem, always happy to help :-)