Skip to main content

Module widgets

Module widgets 

Source
Expand description

The native control behind each Nifty widget, and the objects that report its events.

StructsΒ§

MacWidget

EnumsΒ§

WidgetKind πŸ”’
AppKit holds targets and delegates weakly, so each widget owns its own.

ConstantsΒ§

CARD_BORDER_WIDTH πŸ”’
CARD_CORNER_RADIUS πŸ”’
Matches the corner radius of macOS’s own grouped panels, such as System Settings’.
DIVIDER_SIZE πŸ”’
FULL_PROGRESS πŸ”’
A progress bar is full at this value.
MIN_TEXT_FIELD_WIDTH πŸ”’
Text fields have no useful natural width when empty, so they start at least this wide.
MIN_TRACK_WIDTH πŸ”’
Progress bars and sliders have no natural width, so they start at least this wide.
NO_ITEM πŸ”’
The index that selects no item of a pop-up button.
TEXT_AREA_INSET πŸ”’
The space between a text area’s border and its text, in points.

FunctionsΒ§

behind_window πŸ”’
A translucent material that shows the desktop through the window and dims with the window when it is inactive.
border_on_hover πŸ”’
Draws no bezel until the pointer is over the button, as toolbar buttons do.
click_button πŸ”’
A push button that tells target when it is clicked.
panel πŸ”’
A plain filled box. NSBox resolves its colors when it draws, so it follows dark mode and accessibility contrast without being told.
release_after_event πŸ”’
Hands the object to the run loop’s autorelease pool, which drains after each event.
show_title_beside πŸ”’
Gives an icon-only button its title as its tooltip and what screen readers say. The button itself keeps no title: setting one on an image-only button once it is shown makes AppKit draw it over the image.
system_font πŸ”’
text_alignment πŸ”’
AppKit has a natural alignment but no opposite of it, so the end follows the direction.
text_area_size πŸ”’
A text area’s natural size: the text field’s least width, and lines lines of its font inside its inset and border.
text_color πŸ”’