Change progressbar in custom window
#1
Hello,

I've created my script to control volume instead of XBMC internal. I want to display volume bar on screen. Here is my custom window:

Code:
<window>
    <id>1234</id>
    <type>dialog</type>
    <visible>Skin.HasSetting(VolumeBar)</visible>
    <defaultcontrol>1</defaultcontrol>
    <controls>
        <control type="group">
            <posx>820</posx>
            <posy>0</posy>
            <control type="image">
                <posx>0</posx>
                <posy>-10</posy>
                <width>300</width>
                <height>50</height>
                <texture flipy="true" border="20,20,20,2">InfoMessagePanel.png</texture>
            </control>
            <control type="group">
                <control type="image">
                    <description>Lite Volume Logo</description>
                    <posx>10</posx>
                    <posy>0</posy>
                    <width>40</width>
                    <height>35</height>
                    <aspectratio>keep</aspectratio>
                    <texture>VolumeIcon.png</texture>
                </control>
                <control type="progress" id="1">
                    <description>Volume Progress</description>
                    <posx>50</posx>
                    <posy>8</posy>
                    <width>230</width>
                    <height>18</height>
                    <info>???</info>
                </control>
            </control>
        </control>
    </controls>
</window>

Is it possible to change progressbar in custom window from python script?
Reply
#2
<info>Player.Volume</info>
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
Thanks, but i want to show my own value from python script, not XBMC internal.
Reply
#4
it should be possible to update it from the script yeah.
see the xbmc python docs:
http://mirrors.xbmc.org/docs/python-docs...olProgress

but it kinda depends on how you've coded your addon.

if you use WindowXML, you should be able to do it like this:
Code:
self.progress = self.getControl(1)
self.progress.setPercent(60)

another way that might work is to push the percentage value to a window property
and use that in your skin xml:
Code:
<info>Window(Home).Property(myscript.volume)</info>
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
I tried both variants:

1) WindowXMLDialog - progressbar works fine but problem is that dialog steal focus. It is possible create dialog without stealing focus?

2) custom window via skinning:

My custom1.xml window:
Code:
<info>Window(Home).Property(volume)</info>

In python script i tried:
Code:
xbmc.executebuiltin("SetProperty(volume,50,Home)")
or:
Code:
xbmcgui.Window(10000).setProperty("volume", "50")
but progressbar does not change.
Reply
#6
How are you displaying the window, .show() or .doModal()? doModal locks the focus to the window until it's closed, but .show() should just blit it to the screen
Reply
#7
I tried both methods, show() locks the focus to the window too.
Reply
#8
Hi,
Did you find a solution for the 'stealing focus' problem? I also want to display a window (progressbar) without having it focused... Thanks.
Reply
#9
Hi,
Unfortunately, I don't found a solution...
Reply
#10
As for a volume control, Slider will be a better choice IMO. Also in Gotham a background progress dialog has been added which shows in the top-right corner of the screen.
Reply
#11
Mmhh that's to bad... I read about the new Background progress dialog in Gotham, but I want to have it in Frodo already.
Thanks for your replies!
Reply

Logout Mark Read Team Forum Stats Members Help
Change progressbar in custom window0