|
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
|
|||
|
|||
Question about AddWidgetChild()
Hi,
I want to link certain widgets to existing themes (MainMenuTheme and OptionsConfirmTheme) in my import-hook. I followed the code examples in nielm's imports and got it working, but after looking at the resulting STV file in Studio I noticed the following: the primary reference of the MainMenuTheme under the THEME ORGANIZER tree has become a secondary reference (italicized), and the reference under my imported widget which I linked it to is now the primary one (bold). Strangely, for the OptionsConfirmTheme all references in my imported widgets are created as secondary ones... So, is there a way on the code level to specify that a widget should be a primary or secondary reference ? Or is this simply irrelevant because, as stated in the manual, internally everything is a reference, and the primary/secondary ref distinction is just a Studio concept ? If so, if I remove the widget tree of my widget containing the primary reference will another existing reference then become the primary one ? Thanks a bunch, Dirk |
#2
|
||||
|
||||
I would think that it is irrelevant because the primary/secondary status is just for Studio display purposes. Note that for some reason, the xml STV file format doesn't always keep the primary reference that you specify should be the primary one... if you set a primary, it might not be that way when you reload the file.
And, yes, if you remove a primary reference, then one of the secondary references becomes the primary one. (That is in tutorial 1, for deleting widgets.) BUT, remember that when removing a primary reference, you should not also be deleting its children, because those children are still needed by the other references. (Unless you really do want to delete all those widgets, of course.) - 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
|
||||
|
||||
As Opus says, be careful when deleting the entire tree with a primary widget (expand the children, select all and delete), because you are also removing all children from all the references to that primary widget.
Although this seems obvious, it has caught me out several times -- when working on some widget tree 'in isolation' in a temporary menu, I link it to its final destination, expand the temp menu and delete all widgets... Of course I am now left with the top level widget only in the final destination! Oops!
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki Last edited by nielm; 02-15-2006 at 03:25 AM. |
#4
|
|||
|
|||
Quote:
Quote:
Thanks a lot for these insights ! Dirk |
#5
|
||||
|
||||
I am not sure what RemoveWidget() does if the widget has multiple parents, or children either... But the equivalent to a Studio delete would be:
RemoveWidgetChild(parent, child) My deleteWidgetTree code does something like: Code:
"REM Unlink widget from parent" If Size(GetWidgetParents(widget) == 1 > true RemoveWidgetChild(parent,widget) > else RemoveWidget(widget)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|