Hi,
I am trying to use an integer.gadget in an dynamical GUI-Layout. If I add the gadget to an emtpy window, everything works fine. But if I try to do the very same in a page-layout, the string-box of the IntegerObject is missing.
In both cases I add the gadget to a vertical LayoutObject. What is different, when adding a gadget to a page-layout?
Below is the code I use.
AND
child = IntegerObject, GA_ID, id, GA_RelVerify, TRUE, GA_TabCycle, TRUE, INTEGER_MaxChars, 9, INTEGER_Number, *(ULONG*)ap[i].Variable, End; child = add_child(obj, child, 0, 0, lab); ... Object *add_child(Object *lay, Object *child, int w, int h, STRPTR label) { BOOL added = 0; struct TagItem attrs[] = { {CHILD_Label, 0}, {CHILD_WeightedWidth, 0}, {CHILD_WeightedHeight, 0}, {TAG_DONE, 0} }; if(!child || !lay) return NULL; if(label) attrs[0].ti_Data = (ULONG)pLabel(label); else attrs[0].ti_Tag = TAG_SKIP; attrs[1].ti_Data = w; attrs[2].ti_Data = h; if(w == -1) attrs[1].ti_Tag = TAG_SKIP; if(h == -1) attrs[2].ti_Tag = TAG_SKIP; struct lmAddChild msg; msg.MethodID = LM_ADDCHILD; msg.lm_Window = NULL; msg.lm_Object = child; msg.lm_ObjectAttrs = attrs; added = IIntuition->IDoMethodA(lay, (void*)&msg); return added ? child : NULL; }
If you could supply a fully working example (or the code for it), that may help in tracking down what is happening here.
Simon
Well, I guess there is something wrong with the setup of the page-gadget/clicktab-gadget.
OBJ_INTEGER_1 is crippled, whereas OBJ_INTEGER_2 works just fine.
So, here is a fully working example:
Thanks for the example. There is definitely something wrong here, because Intuition has recognised a problem before the integer.gadget in the page layout is fully drawn. This is shown by trying to resize the window, and the complete machine lock that results.
I'm investigating....
Simon