PDA

View Full Version : PushState() doesn't work, use this...



ameno
May 17th, 2009, 03:27 PM
I previously had been trying to get PushState to work so that when a user hit Escape from a sub-menu it would pop them back up to the menu above it. It almost goes without saying that, like at least 30% of the documented methods... it doesn't work.

My code looked like:

import mc
mc.GetActiveWindow().PushState()

However, after much research, I found a much better alternative


<onclick>SaveWindowState</onclick>

Just be sure that you fire that before any other commands in that event (in this case, "onclick") that might change the layout of the window. Works great.

DPK
May 17th, 2009, 03:42 PM
I definitely feel like the API was shoved out the door rather quickly and got almost no feedback/testing from developers. My experiences are similar to yours when trying to get something to work. I usually try the boxee API way first, only to end up falling back on xbmc methods/functions.

Some of the stuff I want my app to do can't be done with the boxee API (setting Label2's value in a list for example), but xbmc has solutions for. Note that I realize this is not really boxee's fault as its API is in its infancy. Just something us frontiering app devs have to contend with and in the end it's a good story to tell. "30 functions?! I remember when the boxee API only had 5 functions! None of this fancy stuff like you kids have today! SetColor?! We had just three colors! Black, white, and green!" :p

At the end of the day as long as I find a solution to a problem I'm having, I'm content.

ameno
May 17th, 2009, 06:56 PM
I mean I'm no noob when it comes to following APIs. I code for a living and have been around code for about 15 years. At the end of the day as long as I find a solution to a problem I'm having, I'm content.

I'm also content when I find a solution to the problem I am having. The problem with having an API that is underdocumented and untested is that you push developers away. For crying out loud, the main "first app" tutorial doesn't even work if you use the code supplied in the documentation.

Good documentation is absolutely the difference between your project succeeding or failing when much of it is based on independent developers adopting your platform. I also code for a living, specifically focused around digital media. The app we created for my 9-to-5 is one of the ones included in Boxee's off-the-shelf app box. We have actually shelved all further development (version 2) of our app as of this Thursday because it was taking too much time to work through bugs based on undocumented API functions. As a counterpoint, at the saem time we've been building out our Facebook app (we are on version 2.5), and there is yet to be a time when we haven't been able to work through their documentation. They have OVER documented.

With a project like Boxee, if you want up and coming and already established content distributors to take the platform seriously, you have to give their salaried developers and project managers the tools to quickly get a Boxee app up and running. You may not get a second chance at that company if you don't. You think Viacom, for instance, is going to give it another chance if their senior developers and project managers think your platform is whack?

Hobbyist apps are awesome (I have my side one about to launch), but they will not be the engine that drives Boxee to be widely adopted, it will be big players in the game adopting it at a corporate level. I'd love to have dinner with Avner and have this conversation with him, as a professional in this industry, in a lead developer position with a company that has made attempts to embrace the platform.

Look at how long it has taken them to even put the slightest documentation for repositories. :( If I wasn't such a stubborn MoFo, I never would have gotten mine up and running, I would have given up on the project.

lartomar2002
May 23rd, 2011, 02:29 PM
I previously had been trying to get PushState to work so that when a user hit Escape from a sub-menu it would pop them back up to the menu above it. It almost goes without saying that, like at least 30% of the documented methods... it doesn't work.

My code looked like:

import mc
mc.GetActiveWindow().PushState()

However, after much research, I found a much better alternative


<onclick>SaveWindowState</onclick>

Just be sure that you fire that before any other commands in that event (in this case, "onclick") that might change the layout of the window. Works great.
for a non-techie could you explain how i would do this?

bartsidee
May 23rd, 2011, 02:41 PM
Save the trouble, the python api now does the same as the inbuild function. But still lacks:

- Save labels
- Save list focus
- Save list selection

Push state saves the current state of a window without calling a new one. When a users press esc/back the last saved window is shown. this way it makes it easier to work with a single window xml in a menu like way.

lartomar2002
May 23rd, 2011, 05:34 PM
Save the trouble, the python api now does the same as the inbuild function. But still lacks:

- Save labels
- Save list focus
- Save list selection

Push state saves the current state of a window without calling a new one. When a users press esc/back the last saved window is shown. this way it makes it easier to work with a single window xml in a menu like way.
thanks bartsidee, how about the ability to pull the video description/synopsis with the video when we put it in favorites.
on a different subject, i believe you are from Holland.when i was stationed in Germany i was close to Holland and use to go to Eindhoven and Amsterdam all the time, and i had a girlfriend from Weert. you have a wonderful country and love the people. also, my physical therapist is from Amsterdam.