2012-02-01, 22:13
Hello,
I want the button "Cancel" temporarily hide from "DialogProgress.xml". How can I do this?
Thank you
I want the button "Cancel" temporarily hide from "DialogProgress.xml". How can I do this?
Thank you
# get window progress
WINDOW_PROGRESS = xbmcgui.Window( 10101 )
# give window time to initialize
xbmc.sleep( 100 )
# get our cancel button
CANCEL_BUTTON = WINDOW_PROGRESS.getControl( 10 )
# desable button (bool - True=enabled / False=disabled.)
CANCEL_BUTTON.setEnabled( False )
#your code here
[...]
# enable button
CANCEL_BUTTON.setEnabled( True )
ERROR: Error Contents: Non-Existent Control 10
import time
import xbmc
import xbmcgui
DIALOG_PROGRESS = xbmcgui.DialogProgress()
DIALOG_PROGRESS.create( "Custom Progress", "Desabled cancel button..." )
# get window progress
WINDOW_PROGRESS = xbmcgui.Window( 10101 )
# give window time to initialize
xbmc.sleep( 100 )
# get our cancel button
CANCEL_BUTTON = WINDOW_PROGRESS.getControl( 10 )
# desable button (bool - True=enabled / False=disabled.)
CANCEL_BUTTON.setEnabled( False )
#your code here
for i in range( 6 ):
DIALOG_PROGRESS.update( 0, "Enable cancel button in %i second..." % ( 5-i ) )
time.sleep( 1 )
# enable button
CANCEL_BUTTON.setEnabled( True )
DIALOG_PROGRESS.close()