05 January 2019, 18:49 | #1 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Refreshing Visual appearance of gadgets in a KS 1.3 requester
I'm porting an example app from 68k mac System 6, to Amiga with the 1.3 kickstart. I'm thinking about a series of articles maybe for retro challenge, getting into how to start developing, with C, for 68k mac and Amiga, showing the differences, etc.
Anyway, the mac app I started on uses radio buttons. So this makes a nice example for comparing the differences in programming for the Mac "Toolbox" and for Intuition. In this case, Intuition doesn't have any direct radio button support. So I have the gadgets set up, with SelectRender and GadgetRender pointing to images with a dot, and without. I have the logic working, so that if you click one radio button, the others are flipped to off. The problem is that I can't get the requester to refresh. The only thing that works is using the size button on the parent window to basically hide the requester, then expand it. In that event, the Amiga redraws the radio buttons with their new status. I've tried: - change gadget's flag to not include SELECTED, RefreshGadgets(). This "works", but with the proviso above that it doesn't visually work. - Same as above, but with doing Remove/Add Gadget before/after the change to the flag. Similar results, but now the unselected buttons don't render. They are still there, and if you click them, they switch to "selected" mode and are visible. - making the requester slightly bigger, then back to normal size. (hoping that would force a refresh action by the Amiga). - making requester height 0, then back to normal size. (basically, trying to do whatever the size gadget in the parent window was doing). - resizing parent window.height to 0 and back. - rather than changing the SELECT part of the flag, swapping the RenderGadget image to the other one. This "works" but the same way as the above, in that it doesn't show until the requester gets redrawn. - forgetting the images for the radio gadgets altogether, and using DrawImage. I can't get this to render anything. e.g., DrawImage(theWindow->RPort, &imgRadioOff, x, y); - Using OnGadget and OffGadget to try and force visual refresh. The disabling/enabling works, but no visual update. Here is current code:
Snaps are, in order:
Questions:
|
05 January 2019, 19:13 | #2 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
I used RefreshGList...
... and in the docs: "If you wish to do this and be completely proper, you must RemoveGadget(), change the GFLG_SELECTED flag, AddGadget(), and RefreshGadgets(), or the equivalent." |
05 January 2019, 19:34 | #3 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
You know, I honestly thought RefreshGList() was a v39+ thing.
It doesn't do anything different though. |
05 January 2019, 20:09 | #4 | |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 680
|
Quote:
what I notice in my old wierd code: I manually cleared the gadget's rectangle with the background color, befor calling RefreshGList(g, w, 0, 1); and refreshed the unselected too |
|
05 January 2019, 23:39 | #5 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
When you say you cleared the gadget's rectangle, something like this?
I tried various things there, but it doesn't seem to actually get updated at all. It feels like refresh works differently in requesters compared to just a window. |
06 January 2019, 00:18 | #6 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Thanks for help. I did get it working. It was kind of combination of things. In the requester, doing AddGadget/RemoveGadget would never put the gadget back for whatever reason. I mean, it did put it back, but never visually. Taking those out, which is pretty much against everything in the documentation, makes it work.
And of course the other part was I was sloppy and passed the address of the pointer to the window, not the pointer, so the RefreshGList call was not working. <sigh> |
09 January 2019, 02:56 | #7 | ||
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,546
|
Quote:
The easiest way to block input to any random window is simply open an invisible requester on it, then remove the requester when you want to allow input again. The requester doesn't need to have anything in it, so just initialize the entire structure to zero! Quote:
Standard Intuition gadgets are actually quite powerful and fun to play with, particularly if you think 'outside the box'. |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga window refreshing question | thyslo | Coders. System | 2 | 17 November 2018 09:47 |
Wrestlemania 33, Turrican appearance | vulture | Amiga scene | 5 | 05 April 2017 15:46 |
A2000 makes a brief appearance on UK TV | tin | Amiga scene | 0 | 11 March 2017 00:30 |
Refreshing my Picasso IV memory! | dirkies | support.Hardware | 13 | 07 August 2015 17:53 |
Help with the appearance in WB3.1/Scalos | SamSharp | project.ClassicWB | 4 | 10 August 2009 19:14 |
|
|