documentation indexreference manualfunction index

ui.saybehavior

Function: ui.saybehavior (afm=None, dismiss=[ 'dismiss' ], allow_dismiss=None):

This is a pseudo-widget that adds the say behavior to the screen. The say behavior is to return True if the left mouse is clicked or enter is pressed. It also returns True in various other cases, such as if the current statement has already been seen. This widget should not be added to any other widget, but should instead be only added to the screen itself.

If afm is present, it is a block of text, that's given to the auto forwarding mode algorithm to determine the auto-forwarding timeout.

If dismiss is present, it is a list of names of keybindings that are used to dismiss this saybehavior.

If allow_dismiss is present, it should be a function. This function is called without any arguments each time the user initiates a dismiss request. If the function returns True, the dismiss request is allowed, otherwise it is ignored. Added in 5.6.6.

There should only be one saybehavior shown at a time, otherwise they will fight for focus.

Changes

The dismiss parameter was changed in 5.6.1 from a single keybinding to a list of keybindings.


Example

TODO



documentation indexreference manualfunction index