• 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 27
Release PyXBMCt: a Python framework for simple creating UI for XBMC addons
(2016-08-22, 16:02)selli69 Wrote: Thanks for your quick reply!

As you can see in the code, there are TWO buttons: one hello and one close button. both of them dont work. Look at the code I posted, i promise by my mothers life, there are two buttons.. Wink I used this code from your doc

Sorry, I have thought you have played with PyXBMCt example addon. As for your problem, I'm afraid, there is a bug in "Blank" windows that prevent connected functions from firing. I need to fix that. "Normal" windows should work OK.

Quote:One further problem:
As playing around a little more, i added a discrete running thread, which should update the text of a label in the gui. The update works, but it seems to "overwrite" the label in graphics without clearing the previous content, so there is a mashup with all the updated texts. Is it possible to "clear" a control?

And this is Python 101. Instead of updating an existing Label, you are creating a new instance of Label on the same spot over and over again so that multiple Labels are continuously stacked one of top of another.
Reply
Hi Roman..

I have fixed the "update label" thing, setLabel was the solution. thanks anyway...
Reply
Hi, me again.

Quote:As for your problem, I'm afraid, there is a bug in "Blank" windows that prevent connected functions from firing. I need to fix that.

Without the want to rush you in any way, do you have a clue when this fix will be availiable? I need the blank window essentially for my application and if the fix is a long term thing for you, I have to program my addon using the standard kodi window classes (bad thing for me...), because i have a (weak) deadline.

thanks anyway!
Reply
(2016-08-22, 16:40)selli69 Wrote: Hi, me again.

Quote:As for your problem, I'm afraid, there is a bug in "Blank" windows that prevent connected functions from firing. I need to fix that.

Without the want to rush you in any way, do you habe a clue when this fix will be availiable? I need the blank window essentially for my application and if the fix is a long term thing for you, I have to program my addon using the standard kodi window classes (bad thing for me...), because i have a (weak) deadline.

thanks anyway!

To make fix and to push it to my GitHub repo is easy. However, submitting the update to the Kodi official repo is a different thing. Honestly, I don't like this new procedure, though I do understand that the old mailing list system may have been not very convenient for the official repo maintainers. At this point I cannot give you specific dates for the latter.
Reply
Ok. I understand... If it is not that Problem, fixing the bug and push it to github, this will work fine for me as log as i can install your lib manually so it runs on my laptop and i can develop and demonstrate. If it takes some weeks for an update to the official repository its also no matter for me, because i have to develop my addon, which takes some weeks and i have to bring my addon to the official repo also.

Could you please do the fix and bring it to github and inform me/us here in the thread? This will be a very nice thing!
Reply
Hi,

I have completed my work now without using the framework, so there is no more rush for fixing the bug anymore. Thanks anyway.
Reply
Hello Roman!
I have a problem. I'm using multiple Buttons in a Window (20+ buttons), and i'm wondering if i can get quick info on which button is being clicked, or do i have to connect every button to its function?
Reply
(2016-08-30, 18:30)koci5 Wrote: Hello Roman!
I have a problem. I'm using multiple Buttons in a Window (20+ buttons), and i'm wondering if i can get quick info on which button is being clicked, or do i have to connect every button to its function?

You can connect all the buttons to the same function and pass some kind of button ID to this function. This is not trivial but possible. A similar problem was discussed a couple of pages back starting from this post.
Reply
(2016-08-31, 11:04)Roman_V_M Wrote: You can connect all the buttons to the same function and pass some kind of button ID to this function. This is not trivial but possible. A similar problem was discussed a couple of pages back starting from this post.

FIrst of all, thank you for your reply! I looked at that similar problem, but i just can't seem to get it to work. CAn you please look at my code and tell me where i'm doing anything wrong? For now i just want to show a simple dialog with ID of clicked button.

Code:
def set_Connect(self):
        for i in range(0, len(self.buttons)):
            self.connect(self.buttons[i], lambda: self.get_btn_id(i))

def get_btn_id(self, i):
     def get_id():
          dialog = xbmcgui.Dialog()
          dialog.ok('XBMC', 'Button clicked: ' + str(i))
      return  get_id()
Now what do i have to change to get this to work? Thank you!
Reply
(2016-09-06, 20:36)koci5 Wrote:
Code:
def set_Connect(self):
        for i in range(0, len(self.buttons)):
            self.connect(self.buttons[i], lambda: self.get_btn_id(i))

def get_btn_id(self, i):
     def get_id():
          dialog = xbmcgui.Dialog()
          dialog.ok('XBMC', 'Button clicked: ' + str(i))
      return  get_id
Now what do i have to change to get this to work? Thank you!

Look closer at the example you have used. The factory function must return a function object, not a result of a function call. A factory function is called "factory" because it creates new functions with custom properties.
Reply
Hey Roman,

This package is great, very simple and easy to use, thanks for that. I have one question. For TextBox() is there a way to get the text to autoscroll Right to Left instead of Top to Bottom?
Reply
(2016-09-21, 22:47)user76 Wrote: Hey Roman,

This package is great, very simple and easy to use, thanks for that. I have one question. For TextBox() is there a way to get the text to autoscroll Right to Left instead of Top to Bottom?

PyXBMCt does not provide any Controls by itself and can do only as much as underlying Kodi Controls can. AFAIK, ControlTextBox does not have a horizontal scrolling. And, honestly, why do you need such thing?
Reply
How do I open this menu with a kodi listitem?

I can open the menu at the beginning of the addon. But I wanna open it with a listitem.
Reply
(2016-10-01, 09:34)unreal Wrote: How do I open this menu with a kodi listitem?

I can open the menu at the beginning of the addon. But I wanna open it with a listitem.

You mean like in a media plugin? There is no difference where to use PyXBMCt - on the module lever or in functions. Just put your PyXBMCt-related code into the part of your plugin that is called by the respective ListItem.
Reply
(2016-10-01, 14:23)Roman_V_M Wrote:
(2016-10-01, 09:34)unreal Wrote: How do I open this menu with a kodi listitem?

I can open the menu at the beginning of the addon. But I wanna open it with a listitem.

You mean like in a media plugin? There is no difference where to use PyXBMCt - on the module lever or in functions. Just put your PyXBMCt-related code into the part of your plugin that is called by the respective ListItem.

That sounds really easy, but how would that look like. I'm more a java programmer then a python programmer. Maybe that is why is harder for me to implement. Let me give you a idea of our addon. We have a for loop that parses urls from a website. And we add to that a web url link.

Our code is really basic.

PHP Code:
self.addon xbmcaddon.Addon()
    
self.playlist xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    
self.video1 x'
    self.video2 = '
x'
    self.listitem1 = xbmcgui.ListItem('
ZDF', self.addon.getAddonInfo('icon'))
    self.listitem2 = xbmcgui.ListItem('
WEBCAM', self.addon.getAddonInfo('icon'))
    self.listitem1.setInfo('
video', {'Title': 'ZDF', 'Genre': 'Science Fiction'})
    self.listitem2.setInfo('
video', {'Title': 'WEBCAM', 'Genre': 'Science Fiction'})
    self.playlist.add(self.video1, self.listitem1, index=1)
    self.playlist.add(self.video2, self.listitem2, index=0)
    # xbmc.Player().play(self.playlist, self.listitem1) 

and we have a menu with your library, where we send ssh commands to a raspberry that turns a relai on/off.

So how can we open this menu with a listitem. I know from other addons that they use
PHP Code:
if action == '':
        
mainMenu()
#         Single Camera Stream
    
elif action[0] == 'camera':
         
cameraControlWindowDialog CameraControl.CameraControlWindowDialog(cameraNumber[0])
        
cameraControlWindowDialog.start()
     
#Settings
    
elif action[0] == 'settings':
        
Helper.openSettings() 

Do i need that? Or how would that look like. Please tell me a little bit moreSmile
Reply
  • 1
  • 14
  • 15
  • 16(current)
  • 17
  • 18
  • 27

Logout Mark Read Team Forum Stats Members Help
PyXBMCt: a Python framework for simple creating UI for XBMC addons4