Create a simple window
#1
Hi,

I am trying to create a simple window addon using this tutorial.
The problem is that instead of having any sort of window i get a black screen with a progress popup indicating "Loading directory 0 elements".
Whenever I try to define an onAction method, the debug log shows that the script throws an exception in Window.onAction (making it impossible to close)

For info here is my test code:
Code:
import sys
import xbmc, xbmcgui, xbmcplugin

#get actioncodes from keymap.xml
ACTION_PREVIOUS_MENU = 10

class MyClass(xbmcgui.Window):
  def onAction(self, action):
    if action == ACTION_PREVIOUS_MENU:
      self.close()
      
mydisplay = MyClass()
mydisplay.doModal()
del mydisplay

And here is the result:
Image


I guess the xmlgui library has changed since this tutorial was made.
It would help me alot of someone could provide / point me at a simple example of opening a smple window addon that can be closed.


Many thanks
Reply
#2
Your doing a script, not a plugin. Check your addon.xml to ensure you're extending the correct extension point.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
You should look in one of the live add-ons instead.
I started with the debug log add-on. It has a simple GUI and the structure is good making it easy to pull-out the non-gui stuff and put in your own pay-load.
When that is rolling you should be able to put in the stuff from the tutorial.

A few show cases would be nice, the gui components are pretty advanced and some of the existing add-ons is not that easy to read.
Reply
#4
Thanks for the answers guys,

My problem was indeed caused by the wrong extension point.

I'm currently looking at the debug log add-on, it seems to use an xml file for the gui layout. Is it the way to go for supporting different screen resolutions ?

Thanks!
Reply
#5
Ideally, yes.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Create a simple window0