built-in MsgBox function? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: built-in MsgBox function? (/showthread.php?tid=124986) |
built-in MsgBox function? - Eddict - 2012-03-07 is there a way to popup a msgbox like the built-in Notification command, but with eg. Yes and No buttons which can each have there own command(s) behind them. regards Eddict - robweber - 2012-03-07 Eddict Wrote:is there a way to popup a msgbox like the built-in Notification command, but with eg. Yes and No buttons which can each have there own command(s) behind them. I don't think there is a built in function - but here is a workaround if you are willing to put in a little effort. 1) write an addon that uses the xbmcgui.Dialog class. Code: dialog = xbmcgui.Dialog() 2) Upon return of this function (return true/false depending on action) launch the other scripts using the builtin function RunScript or RunAddon 3) you could launch this script remotely or from another addon using the same RunAddon() builtin function. Not as simple as the already available Notification() function but with a little work you could make an addon just as effective (like passing in the addon or script name to branch based on the true/false). - jhsrennie - 2012-03-08 You don't need to write an add-on to do this, just write a Python script and run it by mapping the RunScript function to the input of your choice. JR RE: built-in MsgBox function? - Eddict - 2012-03-12 ok that's good news. i was already diggin into some 'how to write an xbmc add-on' pages, but, although i am a developer, that seemed not that easy... anybody has an eample available of an Pyhton script using a Yes/No Msgbox ? (i did some Googling, but quite some links point to EasyGui library. is this needed?) RE: built-in MsgBox function? - robweber - 2012-03-12 (2012-03-12, 13:31)Eddict Wrote: ok that's good news. i was already diggin into some 'how to write an xbmc add-on' pages, but, although i am a developer, that seemed not that easy... Here is the entire file for the "Manual Run" part of the XBMC Library Auto Update addon. As you can see, it is pretty simple. There is an example of a yesno dialog box and then an if statement based on the result. Code: import xbmc You can also check the documentation on xbmcgui.Dialog at this link: http://xbmc.sourceforge.net/python-docs/xbmcgui.html#Dialog RE: built-in MsgBox function? - Eddict - 2012-03-12 very useful, thanks a lot! RE: built-in MsgBox function? - jhsrennie - 2012-03-12 Create a file (test.py in my case) in your userdata folder containing: Code: import xbmc To test this I put the following in my keyboard.xml: Code: <keymap> The end result is that when I press ctrl-space I get the "Are you sane" prompt (I declined to answer :-). If you want a notification rather than a dialog use e.g.: Code: xbmc.executebuiltin("Notification(Are you sane, You should be locked up immediately)") JR RE: built-in MsgBox function? - Spiderfish - 2018-09-05 Thanks a lot for this example and builtin link is very helpful and let me do a lot of Ideas. Thanks a lot guys! but what if I want to send this dialog to another Kodi or xbmc user in my network? Thanks for all |