How do I display a message to the user?
#1
If I want a quick way to display a short message to the user is there a easy way in XBMC to do this? I'm thinking of something equivalent to the Windows MessageBox function. This is from C++ within XBMC itself, not from a Python script.

JR
Reply
#2
what do you want to display and when ?
Reply
#3
ppic Wrote:what do you want to display and when ?

I've been modifying XBMC to handle the Media Center keyboard shortcuts, e.g. ctrl-shift-P for "play", by mapping them to keystrokes that XBMC recognises, like "P". To help me test various types of MCE remote I'd like to add code to handle the more obscure keypresses, e.g. ctrl-shift-M for "DVD menu", and display a message saying "You pressed ctrl-shift-M" or whatever.

The code would be added to KeyboardStat.cpp in the CKeyboardStat::Update function, so it would run whenever a keystroke is processed. In Windows I'd just use the Win32 MessageBox function, but obviously this isn't going to work with an app using DirectX. Presumably there is an XBMC equivalent since XBMC uses this type of message display in various circumstances. Rather than spending a long time going through the code I hope someone can tell me the name of a suitable function.

This is for my own use. I wouldn't anticipate it being of interest to end users.

JR
Reply
#4
CGUIDialogOK::ShowAndGetInput() or thereabout
Reply
#5
spiff Wrote:CGUIDialogOK::ShowAndGetInput() or thereabout

Thanks spiff. I'm sure a more careful look would answer this, but ShowAndGetInput takes ints as arguments, which are presumably indexes into a string table. If I want to display some random text how would I do this?

Thanks again,

JR
Reply
#6
Code:
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWINDOW(WINDOW_DIALOG_OK);
pDialog->SetHeading("whateva!");
pDialog->SetLine(0,"and his dog!");
pDialog->DoModal();

see CGUIDialogBoxBase
Reply
#7
It works :-)

Thanks,

JR
Reply

Logout Mark Read Team Forum Stats Members Help
How do I display a message to the user?0