XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-19, 01:49   #1
LaundroMat
Junior Member
 
Join Date: Apr 2004
Posts: 3
LaundroMat is on a distinguished road
Default

hi,

i've finally started tinkering with python. thanks to all the helpful people on this and the xbox-scene forums, it was pretty easy to take it up.

a small question though: how do i check against an 'action' sent to my window? i know i can change the onaction method, but i would like to check for a specific action while i'm in a loop of my own (and not via the domodal() method). ie:

Quote:
window.show()
while (action<>action_shutdown):
output('still running!')
window.close
del window
what should the while statement look like?
LaundroMat is offline   Reply With Quote
Old 2004-04-21, 06:20   #2
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

if you want to receive events, then you need to implement the window.onaction() method to receive those events. have you tried implementing the onaction() method and storing the action in a variable that you can check in your mainloop after window.show()? i'm thinking of something like this:

Quote:
isshutdown = 0

class window( xbmcgui.window ):
def onaction( action ):
if action == 10: # previous menu
isshutdown = 1

win = window()
win.show()
while isshutdown == 0:
# do whatever you need to do
win.close()
i haven't tested this code but onaction() is how your window receives events.
madtw is offline   Reply With Quote
Old 2004-04-21, 14:03   #3
LaundroMat
Junior Member
 
Join Date: Apr 2004
Posts: 3
LaundroMat is on a distinguished road
Default

great, thanks!

i thought the actions were only received during a modall() call, but apparently they're not. why on earth i didn't simply try before, i don't know
LaundroMat is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OnAction Problem in xbmcgui.WindowDialog fultotop Plugin/Script (Python) Development 0 2006-07-29 12:41
How do I use the new shortcut method? Mariano XBMC for Xbox Specific Support 11 2006-05-26 23:44
ControlList not yet updated in OnAction()? Xiaolin Plugin/Script (Python) Development 6 2006-01-17 03:22
More actions in onaction Phunck Plugin/Script (Python) Development 2 2005-04-30 00:45
Recommended startup method? maleas XBMC for Xbox Specific Support 4 2004-03-24 20:01


All times are GMT +2. The time now is 01:32.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project