![]() |
|
|||||||
| 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
|
||||
|
||||
|
Is there a better way to do this?
After MANY hours of frustration trying to get my menu table to work, I finally got it. I just kinda stumbled into a "fix", just could'nt see why it would not work and for the heck of it (and to make it look a little cleaner) I took all the guts of the button (see attached image) and made them direct children of the table cell item. Previously this widget chain resided inside a panel object which was the one and only direct child of the table cell object. Viola! it began working as I had intended. Very happy with it now. So my only question is, would any of you guru's code this differently, or have I done
a reasonable job on this? Thanks for any comments, suggestions |
|
#2
|
||||
|
||||
|
Just a few quick comments w/o really studying the code: You don't really need a series of If X == Y... you could use a single If X, then have a series of branches below it containign Y1, Y2, etc.
The action chain executed when the button is clicked must be below the button (item widget), not a panel widget, since the panel is a UI element, not a selectable item/button. And, you should only use a single action chain to be executed below the button, but you can place multiple chains below a single action widget that the button activates. - 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
|
||||
|
||||
|
Quote:
Thanks Andy, I'll definately implement your suggestions and clean this up. I know I also have a problem with how I'm feeding my table. As I add more menus to this stv it will screw up the way I'm indexing into my array of menu names, i.e. I cant guaranty that "my music" will be the first item in the array. So I'll have to fix that selecting which menus go into the array or throwing out the ones I dont want (in the beforemenuload hook) |
|
#4
|
||||
|
||||
|
I'm confused about what you're trying to accomplish with the "menus" array and the LaunchMenuWidget logic. If you're going to have an If branch for each possible menu under your (green) process chain, then why not just link statically to the desired menu, instead of setting up an index into the "menus" array, which you already know you're going to have trouble managing as the STV grows?
On the other hand, if you intend the code to be array-driven, then why stop halfway? Just put all the per-item info into parallel arrays from the gitgo -- the item names, the image paths, the menu names, etc -- and replace all those Ifs with simple array indexing.
__________________
-- Greg |
|
#5
|
||||
|
||||
|
Quote:
Quote:
Thanks for the comments |
|
#6
|
||||
|
||||
|
Quote:
But what I was actually asking is why you're using LaunchMenuWidget to link from one menu to the next, when you already have a unique place in your code for each menu linked to. In other words, instead of setting menunumber = i and then falling through to the common call to LaunchMenuWidget, you could just replace menunumber = i with a static link to the corresponding menu, and dispense with LaunchMenuWidget and the setup of the menus array in BeforeMenuLoad. (That's assuming you keep all those Ifs. If you trade those in for an array-indexing scheme, then those unique per-item linkage points go away and this argument doesn't apply.)
__________________
-- Greg |
|
#7
|
||||
|
||||
|
Quote:
With all these good comments Im anxious to get home and work on it! |
|
#8
|
||||
|
||||
|
I understand what you're getting at, but just as a terminological point, you don't really mean the table cell object. That would be the widget named "CurrentButton" in your example. You want the green process chain to be a direct child of the Item widget (i.e. the one named "image button"), and (as Andy said) you want just one green child of that widget. (My habit is to make a comment widget that says "REM Process chain" under every Item for just this purpose.) This is true for any Item widget, not just the ones that are in tables. So the table cell really has nothing to do with that part of it.
__________________
-- Greg |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|