Text datatype

This forum is for general developer support questions.
Post Reply
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Text datatype

Post by gdridi »

Hello !

I want to use the datatype library to display a text file.

I found code in the wiki for sound data :
https://wiki.amigaos.net/wiki/Datatypes ... lications.

I tried to complete the code with AddDTobject() to a window and Refresh it as shown earlier in the wiki page but nothing displayed !

Is there an example for GID_TEXT as for GID_SOUND ?

Thank you,
DGILLES
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Text datatype

Post by gdridi »

Hello !

I progressing slowly in the DataType world : I missed to LAYOUT before refreshing !

Now,
Would like to know how to use the DTA_TextFont to set a different font in my window, where text.datatype render.

Because it didn’t set/change the font as hoped with DTA_TextFont, my_font !

It seems possible, nevertheless, because with Multiview program (which use .datatype class ?) we can specify FONTNAME=myfont in the command line.

I believe that I have to set the attribute Font of the _super class_ of my newly (datatype instance) object GID_TEXT and not the subclass ; isn’t it ?

Thank you,
DGILLES
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 10:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Text datatype

Post by javierdlr »

Example attached using DTA_TextAttr (in case is it usefull).
To compile: gcc testdt.c -o testdt -gstabs -Wall -D__USE_INLINE__ -lauto

Example from CLI/Shell: testdt testdt.c
Attachments
testdt.LhA
C source
(2.4 KiB) Downloaded 218 times
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Text datatype

Post by gdridi »

Hello !

I try DTA_TextAttr instead of DTA_TextFont , same issue.

Shortly, I certainly have to create a text.datatype for my needs… examples of compilation for this ?

The wiki, lacks some hint about to compile examples for the "Writing Datatype" section.

Thank you Javier,
DGILLES
blmara
Posts: 76
Joined: Thu Jun 23, 2011 9:03 am
Location: Vantaa, Finland

Re: Text datatype

Post by blmara »

@gdridi

I use text.datatype with configurable font setting in Bibvision bible text viewer. Font is opened with OpenDiskFont() before NewDTObject as text.datatype seems not to search for disk fonts if they are not in memory. When changing font, the datatype is removed from the window and reopened to show the contents with the new font.

Marko
Marko
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Text datatype

Post by gdridi »

Hello!

Thank a lot, it will be useful.

I will test it - remove the datatype, chg the font of the window and Reload the datatype.

Regards
User avatar
gdridi
Posts: 64
Joined: Sat Aug 11, 2012 10:17 am

Re: Text datatype

Post by gdridi »

Hello !

Multicore at AmiWest23 (DevCon1)

Why running only with a primitive shell window before the launch of Workbench and run only commands in a multicore environment?

Perhaps the core dump (a crash) after 20 seconds is due to the launch of screen saver..

Bye, courage
Post Reply