Quite a regular
Joined: 2006/12/6 20:39 Last Login
: 11/21 22:41
From California, Unitied States
Group:
Registered Users
|
Two questions, (OS4 release 4.1 Final Update 2 with Enhancer 2.1)
1. Is it required to remove your gadget or gadget list before changing gadget attributes and then add them back after the change? IIntuition->RemoveGList(windows[WID_MAIN], gadgets[GID_MAIN], -1); IIntuition->AddGList(windows[WID_MAIN], gadgets[GID_MAIN], 0, -1, NULL);
2. When I do the above I get problem of the Front to back window gadget swaping places with the Resize gadget. Any idea why this happens?
I have some code that creates a window with a bunch of gadgets. When the window first opens the top right Window barder gadgets in the order they should be in. Iconify gadet first, followed by the Resize gadget, then the Front to back gadget frutherst to the right. When I remove all window gadgets, then add them back the Front to back gadget switches places with the Resize gadget, so the Resize gadget is now the right most gadget.
I did a test where I create the window, then remove the gadgets and re-attach the gadgets and the problem occurs. The code looks like this:
windows[WID_MAIN] = (struct Window *) RA_OpenWindow(objects[OID_MAIN]); display_info_request(objects[OID_MAIN], REQIMAGE_ERROR, "PAUSING PROGRAM!!.\n\n"); IIntuition->RemoveGList(windows[WID_MAIN], gadgets[GID_MAIN], -1); IIntuition->AddGList(windows[WID_MAIN], gadgets[GID_MAIN], 0, -1, NULL); display_info_request(objects[OID_MAIN], REQIMAGE_ERROR, "PAUSING PROGRAM!!.\n\n");
When the first requester appears, the gadgets are in the order they should be in. When the second requester appears, the Front/Back gadget has switched places with the Resize gadget.
Here is my Window structure: objects[OID_MAIN] = WindowObject, WA_Title, PROG_NAME PROG_VERSION, WA_DragBar, TRUE, WA_CloseGadget, TRUE, WA_SizeGadget, TRUE, WA_DepthGadget, TRUE, WA_NewLookMenus, TRUE, WA_Activate, TRUE, WINDOW_IconifyGadget, TRUE, WINDOW_AppPort, AppPort, WINDOW_Position, WPOS_CENTERSCREEN, WINDOW_LockHeight, TRUE, WINDOW_NewMenu, mynewmenu, WINDOW_GadgetHelp, cmds.hint_mode, WINDOW_HintInfo, &mytips, WINDOW_ParentGroup, gadgets[GID_MAIN] = (struct Gadget *)VLayoutObject, LAYOUT_SpaceOuter, TRUE, LAYOUT_SpaceInner, TRUE, LAYOUT_DeferLayout, TRUE, LAYOUT_AddChild,SpaceObject,End,
Edited by ktadd on 2022/4/7 18:38:54
|