in my BibVision program I use text.datatype object embedded into a layout.gadget for viewing contents of a text file. Unlike with the original AmigaOS FE upd2, with Enhancer 2.0 the text datatype seems to fill only part of the layout area reserved for it. While debugging my program I decided to update some working but old-fashioned code. Originally, I loaded the datatype to the layout (originally containg a space.gadget) with something like this:
Code: Select all
...
if (bibobj = IDataTypes->NewDTObject(FNameBuffer,
DTA_GroupID,GID_TEXT,
ICA_TARGET,ICTARGET_IDCMP,
GA_ID,GADM_TEXT,
TDTA_WordWrap,(UseFixedLength ? FALSE:TRUE),
TAG_DONE))
{
/* primary datatype creation succeeded, remove the old and add the new datatype to the layout */
...
IIntuition->SetGadgetAttrs((struct Gadget *)bibwin->Gads[GADM_AREA],bibwin->Win,NULL,
LAYOUT_ModifyChild,bibwin->Gads[GADM_TEXT],
CHILD_ReplaceObject,bibobj,
TAG_DONE);
...
ILayout->RethinkLayout((struct Gadget *)bibwin->Gads[GADM_TOPLAYOUT],bibwin->Win,NULL,TRUE);
...
Code: Select all
uint32 addtags[] = {CHILD_DataType,TRUE,TAG_DONE};
...
IIntuition->IDoMethod(bibwin->Gads[GADM_AREA],LM_REMOVECHILD,bibwin->Win,bibwin->Gads[GADM_TEXT],NULL);
IIntuition->IDoMethod(bibwin->Gads[GADM_AREA],LM_ADDCHILD,bibwin->Win,bibobj,addtags);
Marko
P.S. unfortunately this change in the code didn't help with the problem with Enhancer 2.0. The text.datatype fills the whole layout only when iconified-uniconified, but problem resumes when loading another text file. Thanks to PEB for the tip!