Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • 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 jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #1 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 jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #2 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 jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: Reaction, adding/removing Gadgets from Windows
« Reply #3 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. :)