SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2007, 08:46 PM
perry59's Avatar
perry59 perry59 is offline
Sage Advanced User
 
Join Date: Oct 2007
Location: oregon, usa
Posts: 76
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
Reply With Quote
  #2  
Old 11-17-2007, 09:55 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
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.
Reply With Quote
  #3  
Old 11-19-2007, 11:25 AM
perry59's Avatar
perry59 perry59 is offline
Sage Advanced User
 
Join Date: Oct 2007
Location: oregon, usa
Posts: 76
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
Reply With Quote
  #4  
Old 11-19-2007, 01:44 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
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
Reply With Quote
  #5  
Old 11-19-2007, 02:45 PM
perry59's Avatar
perry59 perry59 is offline
Sage Advanced User
 
Join Date: Oct 2007
Location: oregon, usa
Posts: 76
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.
Reply With Quote
  #6  
Old 11-19-2007, 04:12 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.