Help with dialog.ok
#1
Exclamation 
Hi, I need to show a dialog with a variable numer of lines with an information.

I have a loop:

Code:
show = "\n"
for i in range (1, X):
        show=show+"lalala %i"%(i)



My idea is that my dialog.ok show:

Dialog title
lalala 1
lalala 2
lalala 3
...
lalala 4
[OK]




But, i dont know how i can do it.

Code:
dialog = xbmcgui.Dialog()
        ok=dialog.ok("Dialog title"%,show)



I know that show must be this stlye:
"lalala 1","lalala 2","lalala 3",...,"lalala 4"


So... i tried change the loop:

Code:
for i in range (1, X):
        show=show+"lalala %i"%(i)+","


or

Code:
for i in range (1, X):
        show=show+"lalala %i"%(i)+"\,\"



I need to know how i can make a dialog.ok with a varialbe number of lines.

Thanks in advance.
Reply
#2
Dialog().ok(heading, line1[, line2, line3])

Is this what you're looking for?
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#3
rwparris2 Wrote:Dialog().ok(heading, line1[, line2, line3])

Is this what you're looking for?
I know it, but problem is that i dont know how many lines i will have.


Code:
show = "\n"
for i in range (1, X):
        show=show+"lalala %i"%(i)



X is variable, when scraper is running and use the function I can know the value of X and the number of lines will be the value of X but, in my code I dont know the value of x


When i write Dialog().ok(heading, line1[, line2, line3]) i need know how many lines i will have but i dont know.

Thanks
Reply
#4
Just copy the lines to a fixed sized array of lines (initialized empty) and then call the 3 line version?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
jmarshall Wrote:Just copy the lines to a fixed sized array of lines (initialized empty) and then call the 3 line version?

If i call the 3 lines version, my dialog show 3 lines, no? I dont know how many lines will have to show.

And another problem is sometimes I need to show 8 lines.

X in range (1,8), it is possible with a dialog.ok or similar?


Thanks
Reply
#6
itombs Wrote:If i call the 3 lines version, my dialog show 3 lines, no? I dont know how many lines will have to show.

And another problem is sometimes I need to show 8 lines.

X in range (1,8), it is possible with a dialog.ok or similar?


Thanks
I do not think 8 lines is possible with the standard "ok" dialog. You need to make your own dialog with windowxmldialog if that is the problem (not so easy if you're just getting started!). Depending on your needs, the "select" dialog may be an acceptable alternative.

If you can keep it standard you can make a list and let python know those are your args with the * character http://docs.python.org/tutorial/controlf...ment-lists

PHP Code:
show = list()
for 
i in range (1x):
        
show.append("lalala %i" %(i))
xbmcgui.Dialog().ok("Header", *show
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply

Logout Mark Read Team Forum Stats Members Help
Help with dialog.ok0