Text datatype in a layout.gadget and odd behaviour of DTA_Busy
Posted: Sat May 29, 2021 11:52 pm
Hi,
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:
Now, here https://www.solie.ca/articles/map/boopsi/boopsi.html Steven Solie tells one to use LM_* methods when modifying layout attached to a window. Additionally there is a layout gadget tag CHILD_Datatype for telling this is a datatype. So I replaced the SetGadgetAttrs with this:
Problem: with the original method the text.datatype layout is done another process and an IDCMP hook is used to listen to DTA_Busy messages for turning 'busy' pointer on and off' and DTA_Sync for refreshing scrollers and the layout. With the new method the text.datatype layout is done in the main app when refreshing the layout. However, with the new method IDCMP hook receives only DTA_Busy == TRUE messages (instruction to set window pointer to 'busy') and never DTA_Busy == FALSE. This is true also when resizing the window. Why no 'DTA_Busy == FALSE messages?
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!
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!