Normal
i'm wanting to add a button to an existing screen (myvideosinfo), which when clicked runs a function from my process plugin.at the moment the way i'm doing this is manually adding the button to the skin xml and giving it a new id (say 5555). then in the plugin Start() function i've got a line:GUIWindowManager.Receivers += new SendMessageHandler(OnMessage);the OnMessage function looks like this:private void OnMessage(GUIMessage message){ if (message.Message == GUIMessage.MessageType.GUI_MSG_CLICKED && message.SenderControlId == 5555) { // run my function }}is this the correct way of doing this? is there a better way?
i'm wanting to add a button to an existing screen (myvideosinfo), which when clicked runs a function from my process plugin.
at the moment the way i'm doing this is manually adding the button to the skin xml and giving it a new id (say 5555). then in the plugin Start() function i've got a line:
GUIWindowManager.Receivers += new SendMessageHandler(OnMessage);
the OnMessage function looks like this:
private void OnMessage(GUIMessage message)
{
if (message.Message == GUIMessage.MessageType.GUI_MSG_CLICKED && message.SenderControlId == 5555)
// run my function
}
is this the correct way of doing this? is there a better way?