Disabling buttons
#1
i need a way to disable a button. the xbmc gui button control has a method called setdisabledcolor(...). but how can i make a button disabled?

i tried to find some info on http://home.no.net/thor918/xbmc/xbmcgui.html but it wont say.
Check out my XBMC scripts at http://xbmc.ramfelt.se
Reply
#2
there is no setenabled(true/false) method available like there is for setvisible(). but if you can compile your own xbmc all the needed functions already exist.

in xbmc\lib\libpython\xbmcmodule\control.cpp copy the setvisible method and change it to setenabled, make sure you copy all instances of setvisible.

if a developer agrees, i can add this in and submit a patch. if the code is right, it seems like a good capability.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
sorry, dont have all the necessaary stuff, and i wouldnt like to make a script that requires the latest bleeding edge version.

but i agree with you that this should be patched into the base functionality of xbmc scripting.

thanks for your answer!
Check out my XBMC scripts at http://xbmc.ramfelt.se
Reply
#4
Quote:i wouldnt like to make a script that requires the latest bleeding edge version.

why not? 2.0 will be out, i think most people would update.

but you could always use setlabel() to change the text color. then any control that you set to access it with the controldir(), just set it to a different control. i guess if you don't have a lot of controls, this could work.



For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
nuka has implated new api, so that you can disable.
it was added 05 jun.

Quote: - 05-06-2006 added: [ 1501051 ] setenabled() method, angle to button in python, thanks to nuka1195

i got to say thanks to nuka, that is doing an effort on the python api lately Smile
(and respect to the xbmc team that does a good job)



Reply
#6
great! that is good news, so thanks alot!

but im also a little concerned about older users, so is there any way to request the current xbmc version that the script is running on? ive looked at the python api, but couldnt find anything except , but that is for the api right?
Check out my XBMC scripts at http://xbmc.ramfelt.se
Reply
#7
yes you can. thanks to nuka again. he recently added api that you can use to get the builddate. and the builddate is most likely the same date the source was downloaded.

       try:
xbmc.getinfolabel("system.builddate")
       except:
print "no infolabel,that means that this is most likely pre 29-05-2006"
# - 29-05-2006 changed: updated xbmc.getinfolabel and xbmc.getinfoimage to take in string arguments, thanks to nuka1195.
# - 28-05-2006 added: [ 1496246 ] xbmc.getinfolabel(int) & xbmc.getinfoimage(int) to python, thanks to nuka1195.



Reply
#8
nice! perhaps a version would be fine also?

btw, could you update your python documentation with labels that can be used, and perhaps other constants that is used in every other script (action_move_left = 1) etc?

or is this info available in the xbmc manual? i know i tried to find the consts for the actions in the manual, but had a really hard time to find it.
Check out my XBMC scripts at http://xbmc.ramfelt.se
Reply
#9
version?
that is not updated much.
currently = '1.3'
but that has been unchanged in over a year.much better to do  a builddate check.

by the way, you could code a "try" on the new enable command. if it returns exception, it's not there.

i have added links on the top of the manual to all api that is handy to python devs, in my signatur.
shold be easy to see it.
Quote:api manuals that may come in handy for pydevs:
xbmc online manual: builtinfunctions
xbmc http api commands (quick overview, with link to doc)
******>>>>>>>infolabels/infotags<<<<<<********



Reply
#10
the constants you are refering to are constants you create your self in python.
the python module takes an int value.

here is the source file with action values:
http://home.no.net/thor918/xbmc/stuff/c%20code/key.h

http://manual.xboxmediacenter.de/wakka.p...nids&v=7vp
this overview of actions in the manual is a overview of the actions in string values,these are only usefull if python had used the buttontranslaters ("translateactionstring"), that translates these stringvalues into the xbmc constants that are in the key.h

you can see for your self in this file, where you see all the manual strings is being converted to the values that are listed in key.h.
http://home.no.net/thor918/xbmc/stuff/c%...slator.cpp



Reply
#11
ot: thor, would you want to take a look at what i've done so far with the documentation and see if you have any suggestions that would make it better? i could send the html files or the source files that i've changed?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#12
(thor918 @ june 08 2006,15:21 Wrote:...
here is the source file with action values:
http://home.no.net/thor918/xbmc/stuff/c%20code/key.h
...


is there any way of capturing the left thumb stick movement from python? i seem to be getting action==0 when i do that.
Reply
#13
no theres not at the mo, i did post in this forum a few days back with some coding i done to make it work(which was wrong but could be easily implimented, however for my solution i found python too slow(a cursor) so i just made the dpad jump to my buttons instead.
read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
Reply

Logout Mark Read Team Forum Stats Members Help
Disabling buttons0