Text datatype in a layout.gadget and odd behaviour of DTA_Busy

This forum is for general developer support questions.
Post Reply
blmara
Posts: 72
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Text datatype in a layout.gadget and odd behaviour of DTA_Busy

Post by blmara »

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:

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);
...
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:

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);
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!
Marko
blmara
Posts: 72
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Text datatype in a layout.gadget and odd behaviour of DTA_Busy

Post by blmara »

Hi,

I tested some more and I'm wondering why the layout of text.datatype is working differently in Enchancer 2.0 compared to the plain AmigaOS4. When starting in AmigaOS4, the GA_Width and GA_Height of text.datatype object is similar to the space.gadget object installed into the layout and only few pix smaller than than the layout.gadget width and height. When starting in Enhancer 2.0, it seems that text.datatype object is constantly 320 x 200, and resizing the window doesn't update the datatype size even if the layout.gadget size changes.

Versions: AmigaOS4
- text.datatype 53.12 (28.8.17)
- datatypes.library 54.7 (13.5.16)

Enhancer 2.0
- text.datatype 53.12 (28.8.17)
- datatypes.library 54.11 (4.3.21)

Marko
Marko
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1614
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: Text datatype in a layout.gadget and odd behaviour of DTA_Busy

Post by nbache »

I don't know anything about the technical details in relation to your problems, but if it looks like the original datatype and library work as expected, and the Enhancer replacements don't, it would probably be better to raise the issue over at amigadeveloper.com.

Best regards,

Niels
blmara
Posts: 72
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Text datatype in a layout.gadget and odd behaviour of DTA_Busy

Post by blmara »

@nbache

Thanks, I'll do that!

Marko
Marko
Post Reply