ActionBase (legacy)
ActionBase is deprecated
ActionBase has been replaced by ActionCore. It still works (existing plugins do not break), but new actions should extend ActionCore instead. ActionBase now emits a deprecation warning and is only a thin backward-compatibility wrapper.
What ActionBase is now¶
ActionBase subclasses ActionCore and adds two things purely for backward compatibility:
- It registers the classic key/dial/touchscreen event assigners up front, wired to a compatibility
event_callback. - It re-adds the old
on_key_down()/on_key_up()hooks, which the compatibilityevent_callbackdispatches to (key down and dial down →on_key_down, key/dial up →on_key_up).
Everything else (set_media, set_label, get_settings, connect, launch_backend, …) lives on ActionCore and is inherited unchanged. See the ActionCore reference for the full method surface.
Migrating from ActionBase to ActionCore¶
Old (ActionBase) |
New (ActionCore) |
|---|---|
class MyAction(ActionBase) |
class MyAction(ActionCore) |
Override on_key_down / on_key_up |
Register an EventAssigner with add_event_assigner(...) |
HAS_CONFIGURATION = True class constant |
self.has_configuration = True instance attribute |
Manual get_config_rows with hand-wired Adw rows |
Generative UI rows |
stroke_width= on labels |
outline_width= on labels |
Registering an action still happens through an ActionHolder. ActionHolder accepts both the new action_core= and the legacy action_base= keyword, so a partly-migrated plugin keeps working.
Two methods were also removed/renamed on the class itself:
set_default_image/set_default_label: these never did anything (were "not implemented") and no longer exist. Set your image/label inon_readyinstead.has_label_control()(returning a list) →has_label_control(label_index)plushas_label_controls()for the full list.set_event_assignments(dict)→set_event_assignment(input_event, event_assigner).