Sendkey function needed
#16
down where you set your labels, you need to add a default label. i guess that's what you would call it. in bold.

self.label1 = xbmcgui.controllabel(int(panelx+20),int(panely+40), 200, 25, "")

and it looks like you may have gotten your x and y's mixed upHuh

edit: you can't really tell what's bold it's the: , ""
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#17
thanks nuka1195 i must be blind Blush
the strange thing is i changed this only because it gave syntax errors before...
is there something in the python engine i have to keep in mind?
i had this before were i had a code which gave strange syntax errors and after changing it to something different and then back to the original ( and a few reboots in between) it suddenly worked Huh
Reply
#18
i think if you wouldn't have had the try/except, it may have given you the syntax errorHuh
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#19
one sep further :thumbsup:
but now i have the problem i can not update the labels from other classes:
Quote:class mywindow(xbmcgui.windowdialog):

def ..init..(self):
self.label1 = xbmcgui.controllabel(int(panelx+20),int(panely+40), 200, 50,"starting")
self.addcontrol(self.label1)

#change labeltext try1
mw=mywindow()
mw.show
mw.label1.setlabel("test")
# --> xbox hangs


#change labeltext try2
mw=mywindow()
mw.show
lbl=mw.label1
lbl.setlabel("test")
# --> xbox hangs
how can i get the reference to the label back to the outside of the class ?
do i have to mark the label somehow as public/friend in order to access it?
Reply
#20
you shouldn't have to as far as i know...dunno why that problem occours. python in xbmc is kinda buggy though (or i suck at coding). i suggest you make a function in the first class instead, like:

def changelabel1(self, text):
  self.labelname.setlabel(text)

then you call mw.changelabel1("test") instead. that should work.

-edit-

eh...the show() command could perhaps cause some problems in this case, depending on how it actually works (which i don't know). you could try doing domodal() instead and see if you can change the label then. just a wild guess - i suggest you try the first thing i mentioned first.

-edit2-

i hope you didnt' copy and paste from your code, since you are calling it mw=mywindow() instead of mw=mywindow()
xbmcscripts.com administrator
Reply
#21
thank you enderw! that worked :kickass:

the show works in my code as expected, so i think there is no problem there.

does upper/lower case of functions and variables matter in python?
sorry for the stupid question, i just started python a few days ago and in vb nobody cares about that :d
Reply
#22
upper/lower case matters very much. "object1" and "object1" aren't the same objects. glad to hear that it worked out.

unless you're using show for a specific reason you might want to know that domodal() is much faster at updating and generally better to use. but if it works fine, why change it...i believe the advantage is only seen in certain circumstances.
xbmcscripts.com administrator
Reply
#23
thanks for the clarification.

the reason i use show is that i show and close the window from a different function, if i would use domodal my code would stop.

i finished version 0.1 in which everything except the "silent-mode" works. i just uploaded it to xbmcscripts.com.
Reply
#24
congrats with the release, just approved it. i haven't tried it myself and have no time to do so, but i am sure it works fine  Wink


it is possible to use domodal() and achieve what you want, unless i misunderstand you completely. i don't have time to dig into your code and make corrections though, it's of no use and would be nit-picking.
xbmcscripts.com administrator
Reply
#25
thanks,

so now i just need some guineapig to test and give feedback :evil:
Reply
#26
i believe i might have found a bug though:
Quote: if boldebug:
xbmc.output("starting script timeout in mode:" + str(mode))

#try:
       if mode==3:
               mydisplay = mywindow()
               mydisplay.show()
               
       if boldebug:
               xbmc.output("before starttimeout()")
       starttimeout(mydisplay)
       if boldebug:
               xbmc.output("after starttimeout()")
               
       if mode==3:
               mydisplay.close()
               del mydisplay
               if boldebug:
                       xbmc.output("after del mydisplay")
   #except:
# xbmc.output("error in main function")
notice the indentation (look in the file please, the board messes it up). it will only run that code if boldebug = true, but i think you'd actually want to either remove the commenting of try and except, or remove indentation of the code.

also in the xml the <execute> is set as xbmclyrics.py Smile
xbmcscripts.com administrator
Reply
#27
the strange thing is that it worked... Huh
i corrected it and also updated the script.xml (long life cut 'n' past)

i uploaded it as timeout2.zip, maybe you can change it. timeout.zip was already there.
Reply
#28
changed...

time to finally hit the bed now, if you make corrections please upload (when you're done) and i'll update tomorrow.
xbmcscripts.com administrator
Reply

Logout Mark Read Team Forum Stats Members Help
Sendkey function needed0