invoke_action


Description:

public virtual void invoke_action (PanelAction action)

Invoke the given action on this applet.

This action will only be one that has been declared in supported actions bitmask.

To allow better integration between the Budgie Desktop, and the applets that live within it, the panel will relay actions to applets that have set their supported_actions to a matching bitmask.

For example, if we wish to listen for Menu Key events, we can simply do the following in C:

     static void my_applet_invoke_action(BudgieApplet *applet, BudgiePanelAction action)
{
if (action == BUDGIE_PANEL_ACTION_MENU) {
my_applet_do_predict_the_lottery(MY_APPLET(applet));
}
}

static void my_class_init(GObjectClass *class)
{
MyClass *mc = MY_CLASS(klass);
..
mc->invoke_action = my_applet_invoke_action;
}

Likewise, a Vala implementation might look like the following:

     public override void invoke_action(Budgie.PanelAction action)
{
if (action == Budgie.PanelAction.MENU) {
this.predict_the_lottery();
}
}

Parameters:

action

Action to invoke