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 04-30-2008, 09:49 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Get currently focused widget?

Is there a way to get the currently focused widget so that you could enumerate/search its child widgets?
__________________
-Craig
Reply With Quote
  #2  
Old 05-01-2008, 02:51 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Not as a Widget object, no. GetFocusContext gets the variable context of the focused widget, but not a handle to the Widget object itself. What exactly are you hoping to accomplish by enumerating child widgets that you can't do by creating some Attributes and using GetFocusContext to retrieve their runtime values? There's actually not a lot you can do with WidgetAPI calls that's useful from a UI perspective. Those calls are mostly meant for operating on the widget tree at import/export time or during Studio editing.

This is all assuming you're talking about the UI focus in the Sage UI window. If you're talking about the selected widget in the Studio window, that's a whole different story, and yes, there are ways to access that info using my Studio Tools API.
__________________
-- Greg
Reply With Quote
  #3  
Old 05-01-2008, 07:27 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
I am tracking the "text" of the currently selected item in the Sage UI. I have been using the GetFocusContext() / attribute approach and it works quite well but I then have to add an attribute to everything I want to track. This is not a big deal but I was just wondering if there was a generic way to get at the currently selected widget and then find the first child text widget so that it could be more "automatic". I guess not. Thanks for the reply.
__________________
-Craig
Reply With Quote
  #4  
Old 05-01-2008, 12:22 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
You could use a Theme to automatically generate the Text widget from the Attribute. Then you wouldn't have to repeat both the Text and the Attribute on every item.

Code:
(Item) Item 1
    (Attr) Var = "some text"
    (Theme) Item theme
        (Item)
            (Action) Var
                (Text)
(Item) Item 2
    (Attr) Var = "different text"
    (Theme) Item Theme
(Item) Item 3
    (Attr) Var = "more text"
    (Theme) Item Theme
__________________
-- Greg
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 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
Studio/API wishlist GKusnick SageTV Studio 10 07-25-2006 11:20 AM
How do you determine index number of a widget? jbuszkie SageTV Studio 2 01-13-2006 03:12 PM


All times are GMT -6. The time now is 06:09 PM.


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