Expand description
Helpers for unattended tests: synthetic input posted into the app’s own event queue, and probes of AppKit state. Not for production use.
Functions§
- click_
reaches - Would a click at the centre of the view’s visible part reach the view? (AppKit’s own hit test, so it reflects what a real click would do.)
- drag_
rows - Starts a drag of
table’s view rowsrowsthe way AppKit does (asking the data source for each row’s pasteboard writer) and puts them on a private pasteboard.Noneif the table doesn’t let rows be dragged. - drop_
on_ table - Drops whatever is on
pasteboardontotableabove view rowrow, as AppKit does at the end of a drag: the data source validates the drop, then accepts it.from_tablemakes the table itself the drag’s source. Returns whether the drop was accepted. - drop_
on_ view - Drops whatever is on
pasteboardontoview(a drag destination) as AppKit does:draggingEntered:, thenperformDragOperation:if it offered an operation. Whether the drop was taken. - files_
pasteboard - A private pasteboard holding file URLs, as a Finder drag carries them.
- first_
responder - Class name of the window’s first responder (“host” for the host’s view).
- is_
visible - Whether the mounted view’s clip container is currently shown.
- live_
objects - (models alive, library Objective-C objects alive), for leak checks.
- make_
first_ responder_ raw - Makes a mounted view first responder directly through AppKit, bypassing
crate::focus(as when AppKit moves focus itself, e.g. on a click). - off_
grid - Shown views whose clip frame isn’t on the device-pixel grid.
- pasteboard_
text - The plain text on
pasteboard. - post_
click - Posts a left click at a point in host coordinates (top-left origin, points).
- post_
key - Posts a key-down (optionally with ⌘ / ⇧).
- post_
key_ with - Posts a key-down with explicit modifier flags (e.g. Control for Ctrl-Tab).
- post_
mouse_ move - Posts a mouse move to a point in host coordinates (hover).
- post_
tab - Posts Tab (or Shift-Tab) to the window.
- private_
pasteboard - A fresh private pasteboard (never the general one); release it with
release_pasteboard. - release_
pasteboard - Releases a pasteboard made by
private_pasteboard. - set_
app_ appearance - Forces this app’s appearance (
None: follow the system). The system setting is untouched; windows’effectiveAppearancechanges exactly as on a system switch. - set_
pasteboard_ text - Puts
textonpasteboard. - subview_
count - Number of subviews of the host’s content view (mounted clip containers).
- urls_
pasteboard - A private pasteboard holding web addresses, as a link dragged from a browser carries them (the address, and its text).
- view_
is_ dark - Whether a mounted view resolves to a dark appearance.
- visible_
rect - The visible part of a view as last placed (host coordinates).
- window_
state - (window is key, app is active), for diagnosing posted clicks.