Posts: 96
Joined: Mar 2008
Reputation:
0
how can i get a control to display the current system time?
im building my own gui for my plugin and would like to add a clock.
Thanks
Posts: 1,299
Joined: Jul 2009
Reputation:
59
sphere
Retired Team-Kodi Member
Posts: 1,299
2013-04-06, 10:50
(This post was last modified: 2013-04-06, 10:52 by sphere.)
Use "$INFO[System.Time]" as label.
Posts: 96
Joined: Mar 2008
Reputation:
0
2013-04-06, 21:18
(This post was last modified: 2013-04-06, 21:19 by adrianc1982.)
like this?
self.clock = xbmcgui.ControlLabel(self.porcentaje(40, self.x), self.porcentaje(10, self.y), self.porcentaje(50, self.x), self.porcentaje(10, self.y), '', font='font30', alignment=2)
self.addControl(self.clock)
self.clock.setLabel($INFO[System.Time])
$INFO comes from which import?
where can i see what else does the $Info ?
Will this be a live clock? or do i have to set a timer or something to animate it?
Thanks
Posts: 1,299
Joined: Jul 2009
Reputation:
59
sphere
Retired Team-Kodi Member
Posts: 1,299
Yes.
So you got it working now?
Posts: 96
Joined: Mar 2008
Reputation:
0
2013-04-09, 08:02
(This post was last modified: 2013-04-09, 08:03 by adrianc1982.)
yes thank you very much.
for future reference if anyone needs it, heres the complete code for the actual clock..
self.clock = xbmcgui.ControlLabel(xposition, yposition, xsize, ysize, '', font='font30', alignment=2) #text blank, alignment center
self.addControl(self.clock)
self.clock.setLabel('$INFO[System.Time]') #needs to be send as text, this is not a variable
thats it you get a clock like the one in xbmc. Thanks a lot sphere.
sorry to hiyack the thread do you happen to know how to catch the right click on the mouse without clicking a button to do a back command when right mouse click is detected anywhere the screen?