Hello Amiga Coders!
I'm trying to get deeper in the programing of Reaction under Amiga OS4.
Can someone please show me a litte code fragment about using the layout class
in Reaction without using the RA macros?
I have managed to create a little gui with buttons based on Trixies wonderful tutorial
"Recommended practice in OS4 Reaction programming"
I have a string gadget on top followed by two buttons. Layout is vertically orientated.
Looks quite like this:
--------------
String gadget
--------------
--------------
Button1
--------------
--------------
Button2
--------------
I would like to have someting like:
----------------------------------
String gadget
---------------------------------
-------------- -------------
Button1 Button2
-------------- -------------
Would you be so kind an show me how to achieve this?
I don't need a full working source code example - only the addtion for the layout
Here is the part from my listing to create the window:
/* Create the window object. */
if ( (objects[OID_WINDOW] = IIntuition->NewObject(WindowClass, NULL,
WA_Title, "ReAction AppWindow",
WA_DragBar, TRUE,
WA_CloseGadget, TRUE,
WA_SizeGadget, TRUE,
WA_DragBar, TRUE,
WA_DepthGadget, TRUE,
WA_Activate, TRUE,
WA_InnerWidth, 200,
WA_InnerHeight, 100,
WINDOW_Position, WPOS_CENTERSCREEN,
WINDOW_AppWindow, TRUE,
WINDOW_IconifyGadget, TRUE,
WINDOW_Layout, objects[OID_LAYOUT] = IIntuition->NewObject(LayoutClass, NULL,
LAYOUT_Orientation, LAYOUT_ORIENT_VERT,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_DeferLayout, TRUE,
LAYOUT_AddChild, objects[OID_STRINGGADGET] = IIntuition->NewObject(StringClass, NULL,
GA_ID,OID_STRINGGADGET,
GA_ReadOnly, FALSE,
GA_RelVerify, TRUE,
STRINGA_WorkBuffer, StringInput,
TAG_END),
LAYOUT_AddChild, objects[OID_BUTTON1] = IIntuition->NewObject(ButtonClass, NULL,
GA_ID,OID_BUTTON1,
GA_ReadOnly, FALSE,
GA_Text,"Show Input",
GA_RelVerify, TRUE,
TAG_END),
LAYOUT_AddChild, objects[OID_BUTTON2] = IIntuition->NewObject(ButtonClass, NULL,
GA_ID, OID_BUTTON2,
GA_ReadOnly, FALSE,
GA_Text, "Quit",
GA_RelVerify, TRUE,
TAG_END),
TAG_END),
TAG_END)))
Thank you vermuch for your time an reading!
Greets
Andi
Sun, 2012-09-23 23:34
#1
Reaction Layout without RA Macros