Python problem detecting resolution?
#1
i've created a script that can pop up a windowdialog at any time, but pal users seem to have a problem with it detecting the dimensions of the window. i don't know anything about the pal system, so hopefully this will make sense.

each time my windowdialog pops up, it finds the width and height of the screen to place an image in the bottom right corner of the screen. it seems that when playing a video, a pal system switches to pal60, but the new width and height of the screen are not found. i'm using the getwidth() and getheight() functions of the windowdialog, and it returns the old information.

is this a bug? anybody have any suggestions for a workaround?
Reply
#2
just a guess, i don't really know the inner works of xbmc, but it could be that when you create the class derived from windowdialog that the information is stored statically. that would mean that the getwidth() and getheight() functions just return a static value - it doesn't actually get what's the current value, but instead return the value stored upon creation. i have no idea whether this is correct or not - as i said, it's a guess.

to get by this problem you'd have to create a new object from the class everytime you want to display the dialog.

perhaps something like h = xbmcgui.windowdialog().getheight()

even then i am not sure if that really works (not tried). it could also use a lot of memory as many similar objects would be created after a while. i'm sure there are better workarounds, but i am no python expert. also this suggestion might be way way off Smile
xbmcscripts.com administrator
Reply
#3
i actually have it so that everytime my windowdialog appears it creates a new one which gets deleted when it disappears, but that's what i had thought too.
Reply
#4
id just put it on the top-left ...

anyway i had thought that pal-50 and pal-60 use the same resolution no?
Reply

Logout Mark Read Team Forum Stats Members Help
Python problem detecting resolution?0