The example demonstrates how to add a custom button to a view titlebar and to display the button only for floating dockables (views). The button is used to enable/disable the window state AlwaysOnTop.

All relevant lines are highlighted. Press Run... button to start the example.