Reply to thread

Re: what's the correct way to do this?




I am not sure about correct or better but

they way I have usually seen it done is to put it into

the override of OnClicked and check the control.

(If you are changing code in an existing plugin the override is probably already there)


So after you add the button to the skin.xml file

something like the code below should work.



[code]

[SkinControlAttribute(5555)] protected GUIButtonControl btnRunMyProcessPlugin = null;


protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)

{

   base.OnClicked(controlId, control, actionType);

  

   if (control == btnSomeOtherButton)

   {

      //

   }

   else if (control == btnRunMyProcessPlugin)

   {

      // Insert code here

   }

}


[/code]


HTH

patrick


Top Bottom