script window questions
#1
Another quick question or three about windows defined by a addon. Are the windows built and destroyed on the call and end of a script? can I call the window from the skin side if so do I have to use runscript or something of that nature or can I just call ActivateWindow("Mycustom_window")? Also if I make a window can I have a have a custom context menu without the normal kodi item, Add to favorites?
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#2
(2018-02-28, 01:47)smitchell6879 Wrote: Are the windows built and destroyed on the call and end of a script?
correct

(2018-02-28, 01:47)smitchell6879 Wrote: can I call the window from the skin side if so do I have to use runscript or something of that nature or can I just call ActivateWindow("Mycustom_window")?
nope, you can't "call" a script window directly. you need to run your script, and have the script open the window.

(2018-02-28, 01:47)smitchell6879 Wrote: Also if I make a window can I have a have a custom context menu without the normal kodi item, Add to favorites?
sure, see our python docs: https://codedocs.xyz/xbmc/xbmc/group__py...b690163bef
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
(2018-02-28, 02:05)ronie Wrote:
(2018-02-28, 01:47)smitchell6879 Wrote: Also if I make a window can I have a have a custom context menu without the normal kodi item, Add to favorites?
sure, see our python docs: https://codedocs.xyz/xbmc/xbmc/group__py...b690163bef

that is for a dialog window... I was looking to use the builtin kodi contextmenu where listitem.addcontextmenuItems but remove add to favorites
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#4
nope, it's not possible to remove items from the builtin context menu.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
:/ Thanks
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#6
https://codedocs.xyz/xbmc/xbmc/group__py...utton.html
self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')

So I have added a button to the home window... just for testing...I defined the button as above.. and looking at the docs I am missing something very important... How do I set the action of the button?
ControlRadioButtons has setSelected() but I don't see a setOnclick() for a normal button.
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#7
i have little to no experience with the Window class, so not 100% sure, but i guess you need to use the onControl() method:
https://codedocs.xyz/xbmc/xbmc/group__py...ec6f335884
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
I will test tonight and I was so focused on the other section I was in I totally over looked all of the those functions thanks agian
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#9
(2018-02-28, 15:35)smitchell6879 Wrote: So I have added a button to the home window... just for testing...I defined the button as above.. and looking at the docs I am missing something very important... How do I set the action of the button?
ControlRadioButtons has setSelected() but I don't see a setOnclick() for a normal button.

While you can add controls to existing windows from Python, interactive Controls (Buttons and such) won't work because you have no control over existing windows' events. You can use interactive controls only in windows that you fully define yourself. The only way to add an interactive control to an existing Kodi window is to modify the respective skin XML file.
Reply
#10
Thanks that's what I wanted to know..
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply

Logout Mark Read Team Forum Stats Members Help
script window questions0