[mythtv] Adding A Clock To The Watch Recordings Screen
kuphal at dls.net
Wed Dec 14 20:51:03 EST 2005
ben levitt wrote:
>I'm trying to add a clock UIType so that Myth themes can include a
>clock in themed dialogs.
>I'm doing this because I want a clock on the watch recordings screen,
>so I'll know if I should watch another MythBusters, or go to sleep.
>I created a subclass of UITextType called UITimeType. It runs a timer
>that is correctly calling back to the UITimeType's animate method
>every second. This method is correctly updating the text of the
>UITimeType, and calling refresh();
>The remaining problem is that the clock only updates on the screen
>when I manually cause an overlapping UIType to refresh, for example,
>by scrolling up/down in the recording list.
>How can I force the UITimeType to update itself on the screen every
>time its timer calls its animate() method?
>Do I need to get ahold of the MythDialog and tell it to refresh the
>bounds of my UITimeType, as the UIAnimatedImageType seems to do? If
>so, how the heck is UIAnimatedImageType's m_window getting set?
Typically things are redrawn on the screen during an updateRect call.
You might want to look at the timer code in playbackbox that updates the
preview video. It runs on a timer and paints that part of the screen.
Typically the code calls the theme subsystem to get the Rect for a
particular UI element, then updates that as appropriate. Your Rect
could get updated in a timer that fires every second and then repaints
that part of the screen only.
Looking for affordable webhosting? http://www.sitecity.net
More information about the mythtv-dev