Repository navigation
chooser.gadget: pop-up list, label arrays, ReAction look - #1852
Open
terminills wants to merge 7 commits into
Open
terminills wants to merge 7 commits into
terminills wants to merge 7 commits into
Conversation
The class headers name Class but did not include intuition/classes.h, so a program including only <proto/chooser.h> (or the stubs below) failed to compile; every class cdef now includes it. chooser, clicktab, layout, listbrowser, radiobutton and speedbar declare the varargs forms of their tag-list functions - AllocListBrowserNode(), SetChooserNodeAttrs(), AllocSpeedButtonNode() and the rest - as their AmigaOS clib headers do; the stubs are in libreaction.a.
libreaction.a gains what reaction.lib offers programs on AmigaOS: ChooserLabels(A), ClickTabs(A), RadioButtons(A), BrowserNodes(A) and their Free* functions build and free label lists through the classes' own allocators; LBAddNode(A), LBEditNode(A) and LBRemNode() wrap the listbrowser methods. Prototypes in <clib/reaction_lib_protos.h>. The varargs forms of the class tag-list functions (19, declared in the class headers) are implemented here as well. ClassAct 2's example sources compiled against these: 17 of 30 build, from 6; the rest use SAS/C register syntax or ClassAct-only tags.
Forty-one files defined DEBUG 1 and logged every method call to the debug output.
reaction_labels.c and reaction_varargs.c include the protos of chooser, clicktab, layout, listbrowser, radiobutton and speedbar, which are generated by those classes. In a fresh build tree the link library could be compiled first and failed with proto/chooser.h missing.
Clicking the chooser cycled to the next entry like a cycle gadget. It now opens its list under the gadget: the entry under the pointer is highlighted, releasing on an entry picks it, a plain click on the gadget leaves the list open for the next click, and a click elsewhere or the menu button closes it. Separators and disabled entries are drawn and cannot be picked. CHOOSER_LabelArray builds the class's own label list from a NULL-terminated string array (it was accepted and ignored), freed when replaced or on dispose; an open list is closed on dispose. ShowChooser() opens the list at a position in the window and HideChooser() closes it, completing the chooser.gadget function table (version 45.3).
The list's hit-test read the screen's mouse position, which is not kept current while the gadget holds the input; it now uses the event's own coordinates, relative to the gadget. Pressing on the chooser, dragging to an entry and releasing picks it (QEMU: ClassAct's chooserexample, 1200 -> 2400). GM_DOMAIN reports the chooser's size - widest label plus the arrow box, one text line high - so layouts no longer have to guess it.
A raised frame like a button, the entry centred left of the glyph box, and the double chevron of a pop-up chooser (the down arrow stays for CHOOSER_DropDown). Pop-up is the default mode, as in ReAction; the class defaulted to drop-down. Compared with ClassAct 2's own screenshots (NewYork's display preferences) in QEMU with ClassAct's chooser example.
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1851 (its commits are included; review the last three).
Built for pc-x86_64 and pc-i386; QEMU (x86_64): ClassAct's chooser example opens, the list pops up and a pick is reported.