|
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
|
||||
|
||||
for loop ?
Probably a dumb question, but...
How would I create a "for loop" in Studio? For example I want to build a semi dynamic menu by having a table which acts as the menu. To feed this table I have a "dummy" menu which just contains item widgets representing buttons (focus/nofocus image & label) for the menu. So, in my "real" menu I want to do something like : for each widget in dummy menu add widget to this table Then, I can add or subtract items from the dummy menu, and the real menu will reflect those changes. Do I need to do this "externally" with java, or can it be done natively in studio? I have some programming experience, but java and sage are totally new to me! Thanks Last edited by perry59; 11-17-2007 at 08:47 PM. Reason: grammer |
#2
|
||||
|
||||
Have you checked tutorial 10 "Loops" in the Studio manual? There should be a sample basic loop there. Inside the loop, you could add items to an array/vector/whatever to create the list of enabled button types that gets fed to the table.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#3
|
||||
|
||||
Sheesh, sometimes I think that the alheimers is already setting in, and I'm not even 50 yet !
I really did read the manual ! Guess since I didn't see those familiar words like "for", "do" or "while", I didn't remember the loops tutorial. But rather that using such a construct to get what I want, there must be a better way, or is there.... I feel another post coming on |
#4
|
||||
|
||||
Maybe you need to work through the Table tutorial as well, and look at some working examples of table-based menus such as Favorites Manager and SageTV Recordings. Building a menu with repeating elements isn't a matter of explicitly looping over a data structure and patching widgets together on the fly. Just feed your array- or list-based data to a Table widget, and place under it one copy of the per-item widget structure you want. The Table will automatically iterate over the data and generate the required number of per-item widget instances. Those per-item widgets can include conditional branches if you want some items displayed differently than others.
Again, the tutorial exercises cover all this pretty well, so if you haven't actually worked through them in Studio, you should.
__________________
-- Greg |
#5
|
||||
|
||||
I have gone through the tables tutorial. If I could retrieve my data via a stock api call it would probably be a lot easier.
I've also tried looking at menus in the default stv which utilize tables. Trying to follow that stuff tends to produce migrains. And again they all utilize pretty much the same api calls. |
#6
|
||||
|
||||
I'll post it here to as it may be a bit more applicable:
http://forums.sage.tv/forums/downloa...?do=file&id=47 It was an experiment from a while ago, but I think it might kind of do what you want. It's got some "generic" code to build the buttons, and then relies on specific code in each menu widget to define what those buttons are. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|