Closing the script before it's opened
#1
hi there...
i've got a new problem Wink
when my script starts, a keyboard gets popped up.
now i want the script not to go on (self.close()) in case that i cancel the keyboard.
i tried it with the following (in init):
Quote: if keyboard_on_startup == 1:
keyboard = xbmc.keyboard()
keyboard.domodal()
if (keyboard.isconfirmed()):
self.searchmovie(keyboard.gettext())
else:
self.close()
but it seems like the keyboard is opening prior the window, so it is not able to close the (not opened) window.

does anybody have a solution for this?

thanks

[edit]
the code is at the end of the init().
the window is drawn completeley before the keyboard code.
[/edit]
Reply
#2
something like this?

Quote:def start():

   confirmed = false
   while not confirmed:
       keyboard = xbmc.keyboard()
       keyboard.domodal()
       confirmed = keyboard.isconfirmed()
       if (confirmed):
           print keyboard.gettext()

   self.close()

start()
Reply
#3
i recommend:
Quote:w = yourwindow()
w.show()
keyboard = xbmc.keyboard()
keyboard.domodal()
if(keyboard.isconfirmed()):
w.domodal()
else
w.close()
Reply
#4
mmhhh ops...

i didn't undestand the question...
:nuts:

consider only asteron code...
Reply

Logout Mark Read Team Forum Stats Members Help
Closing the script before it's opened0