StringChooser(3I)
β¨ NAME β¨
okay bestie, this is StringChooser(3I), and it's from the InterViews Reference Manual. StringChooser is literally a dialog box for choosing items in a list. it's giving "pick a string, but make it a whole focus-management situation." π
π¦ SYNOPSIS π¦
#include <InterViews/strchooser.h>
π DESCRIPTION π
okay so StringChooser is a dialog whose whole thing is managing keyboard focus between a StringBrowser and a StringEditor, so choosing strings feels convenient. You can select strings either by selecting them in the StringBrowser or by typing them in the StringEditor. And bestie, like Dialog, StringChooser is an abstract class; programmers must derive from StringChooser to add push buttons, etc. and to compose them into custom arrangements. no direct instantiation energy here. π
you can point keyboard input at either the StringEditor or the StringBrowser. Wanna focus the StringEditor? left-click in its canvas and it'll interpret subsequent keyboard events. When either the StringEditor or the StringBrowser relinquishes keyboard focus, the other acquires it: for example, the user can toggle focus between the two by pressing the tab key repeatedly. And if an entry in the StringBrowser is selected when it loses focus, the (first) selected string will be transferred into the StringEditor. periodt. β¨
π PUBLIC OPERATIONS π
StringChooser(ButtonState*, int rows, int cols, const char* sample, Alignment)andStringChooser(const char* name, ButtonState*, int rows, int cols, const char* sample, Alignment)β Construct a new StringChooser with the given button state and pop-up alignment. These constructors create aStringBrowserof the specified size and aStringEditorwith the given sample string. TheStringChooser,StringBrowser, andStringEditorall share the same button state.void Select(int point),void Select(int left, int right),void SelectMessage()β Select an insertion point, a subrange, or the entire edit buffer in theStringEditor.void Message(const char* text)β Set the contents of theStringEditor's edit buffer to text.virtual const char* Choice()β Return the chosen string. The string is returned in a static buffer and should be copied before use.
β οΈ bestie, Choice() hands you a string living in a static buffer, so copy it before use. don't skip that part. π
π PROTECTED OPERATIONS π
StringChooser(ButtonState*, Alignment = Center)β Construct a new StringChooser with the given button state and pop-up alignment without creatingStringBrowserandStringEditorinstances. This constructor should be called in subclasses that require a specializedStringEditororStringBrowseror both.void Init(StringEditor*, StringBrowser*)β Initialize theStringEditorandStringBrowserthatStringChooserwill use. This function is useful in the constructors ofStringChoosersubclasses that require a specializedStringEditororStringBrowseror both.virtual void SwitchFocus()β Prepare to shift keyboard focus to theStringBrowserif theStringEditoris focused currently, and vice versa. Focus actually changes whenHandleFocusis called (see below).virtual boolean CanFocus(Interactor*)β Return whether or not the given interactor can be focused. This function is used to determine whether theStringChoosershould switch focus in response to a downclick.virtual void HandleFocus()β Transfer event reading to theStringBrowserorStringEditor, whichever is the current focus.virtual void UpdateEditor()andvirtual void UpdateBrowser()β UpdateStringEditorandStringBrowserstate when the dialog is accepted or in response to a change in focus. This function guarantees that theChoiceoperation will return the last choice. By default,UpdateEditorchanges theStringEditor's contents to match theStringBrowserselection (if any), andUpdateBrowserclears out any selected strings in theStringBrowser.
π SEE ALSO π
Button(3I)Dialog(3I)StringBrowser(3I)StringEditor(3I)
okay that's the whole vibe π this page is from InterViews, dated 30 November 1989, and yes bestie, it's StringChooser(3I) signing off. mwah π
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms