Kodi Community Forum
Closing the script before it's opened - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Closing the script before it's opened (/showthread.php?tid=11370)



- dderichs - 2005-04-14

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]


- sambarza - 2005-04-14

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()



- Asteron - 2005-04-15

i recommend:
Quote:w = yourwindow()
w.show()
keyboard = xbmc.keyboard()
keyboard.domodal()
if(keyboard.isconfirmed()):
w.domodal()
else
w.close()



- sambarza - 2005-04-15

mmhhh ops...

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

consider only asteron code...