05 October 2018, 09:26 | #1 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
Beginner questions: text display in an Intuition window and scrolling
Hi everyone,
As a beginner in Amiga C programming I set me the task to read a text file line by line and display it inside an Intuition window (v37/2.04). This is working so far. For window opening I used the following struct TagItem (excerpt) Code:
struct TagItem windowTags[] = { … { WA_IDCMP, IDCMP_MENUPICK | IDCMP_VANILLAKEY | IDCMP_RAWKEY}, { WA_NewLookMenus, TRUE }, // Ignored before v39 { WA_Flags, WFLG_GIMMEZEROZERO }, { WA_SmartRefresh, TRUE }, { TAG_DONE, NULL }, }; Then I implemented a basic scrolling for the cursor up/down keys. The scrolling uses graphics.library / ScrollRaster() to move the visible text one line up/down an then fill the appropriate line at bottom/top with PrintIText. But now I'm kinda stuck and have questions which I can't find an answer, so I ask them here: 1) Is this the right approach to display and scroll text on AmigaOS v37/2.04 or is there some more automatic solution inside the OS which I'm not aware of? 2) I'd like to go a step further and add scrollbars to the window. How can I achieve this? Do I have to set a flag/TagItem at OpenWindow or are scrollbars only possible if I'd use a SuperBitmap window? Or have the scrollbars to be manually added after opening the window? |
06 October 2018, 08:57 | #2 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Hehe,
I was about to ask the same questions. I asked already for this somewhere else (but have not started writing yet my own program) and I know I could use: ClearEOL(), ClearScreen(), SetWriteMask() (to speed up a little), DoHookClipRects() ( advanced), ScrollWindowRaster() Also I was told to use separate bitmap and then transfer everything to the window at one go. But still don't know about scroll bars... |
06 October 2018, 10:27 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
|
06 October 2018, 17:40 | #4 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Thank you.
|
06 October 2018, 18:14 | #5 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
You might have noticed that the example uses OS 1.x methods.
In the meantime I converted the example to use OS 2.x methods (scroller2.c). There is also an older example which adds arrow buttons beside the scroll bars (scroller3.c). |
06 October 2018, 19:32 | #6 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
These examples are very helpful - everything in one place.
Great !! |
07 October 2018, 18:47 | #7 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 189
|
Many thanks for the examples:-)
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Making a Cracktro-Like Text Scrolling Effect | mattbarton.exe | Amiga scene | 12 | 31 May 2022 21:12 |
Amiga Emulation Beginner: Questions | beaglelover | New to Emulation or Amiga scene | 1 | 18 February 2016 04:11 |
Intuition paints its Gadgets over my Window Borders | AGS | Coders. System | 0 | 08 January 2014 17:50 |
Intuition window WinAPI integration? | Mequa | support.WinUAE | 10 | 12 November 2010 21:46 |
5 more beginner questions ( A 3000) | amiganer | support.Hardware | 20 | 15 August 2007 07:45 |
|
|