|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
OK to put text widget at end to make UI chain complete?
Is it OK to stick a text widget at the end of a widget chain in order to complete a UI chain? In my code I am checking for various error conditions and if they exist I want to write a DebugLog() message. The problem is if a UI chain does not have a UI widget at the end it doesn't get executed. To get around this I've been putting a text widget at the end of the chain. Am I asking for trouble?
Here is mock-up example: Code:
If expression=x Display some image on the UI else if expression=y Display some other image on the UI else if expression=z DebugLog("This should never occur.") Text Widget Here
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#2
|
|||
|
|||
Don't know about any side effects.. I have some debugs in the ui as part of a chain but display pictures and such after it.
I don't understand why you have it part of the ui if you are not drawing anything or displaying anything ?? |
#3
|
||||
|
||||
It's error checking. If I get to one of these places it is because there is nothing to display but there should be. If I had an image to display I would
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#4
|
||||
|
||||
Using dummy text widgets does work, and I've resorted to it once or twice myself, but I don't like doing it and usually try to look for a better way of structuring the code that makes it unneccesary. The thing is that those unreachable text widgets aren't free; they do get instantiated when the menu is loaded, but never actually get drawn on screen (unless execution reaches there somehow). So if you make a habit of this, you could end up larding up your UI with a lot of invisible junk.
In your example I'd probably be inclined to do the error checking before entering the If: Code:
DebugLog(If(expression == z, "error", "OK")) If expression ... Code:
mypackage_myclass_Assert(expression != z) If expression ... By the way, you're not obliged to keep writing "else if expression==". An If widget also works like a case statement, which is what you want in your example: Code:
If expression > x ... > y .... > else error
__________________
-- Greg |
#5
|
||||
|
||||
Thanks Greg. I knew how to create a case statement (my example was a poor choice) but I did not think about error handling in that way. Very slick. I've got to stop thinking like an assembler programmer ans start thinking like a java programmer.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to get blank line in text widget? | cncb | SageTV Studio | 2 | 07-20-2008 05:44 PM |
When are Text widget properties refreshed? | JREkiwi | SageTV Studio | 9 | 05-03-2007 09:35 AM |
Scaling Text widget size within image widget area | Morgan111 | SageTV Studio | 2 | 12-04-2006 02:16 PM |
Text input widget, copy from clipboard | nathanm | SageTV Studio | 2 | 10-27-2006 05:47 AM |
Complete noob with low end system | comptechltd | Hardware Support | 2 | 07-14-2003 10:35 AM |