On Thursday 27 February 2003 3:44 pm, Wendell Turner wrote:
> I would like to determine which tab of a TabSet a user has
> clicked on (and is now visible). Also, the TabSet is
> inside a panel.
>
> Q1) It seems that upon clicking on a tab, the parent _Dialog
> is getting an event, but the ev.get_component() is the
> panel. How do I 'look inside' that event for (say) a
> sub-event, that is the TabSet?
I'm not sure how that's happening. As far as I can see, TabSet doesn't fire
an event itself when the user selects a new tab. That's a missing feature I
think. If you really need to know this, I would suggest subclassing TabSet
and overriding the method set_which_one(x) with something like
class MyTabSet : TabSet
method set_which_one(x)
TabSet.set_which_one(x)
... handle the change
end
end
Not pretty, but it'll work.
> Q2) In playing with listing 17-3 from the book, there is an
> event when the tab is clicked on, but the ev.get_component()
> is the tabset. Is there a method similar to
> 'get_selected()' (I already tried that one, and it doesn't
> exist for a TabSet) by which I can determine the tabbed page
> in view?
>
That's another missing feautre :-) There is a member variable "which_one",
with a setter method (see above), but no getter method. But you can just say
tabset.which_one and that'll give you the current tab.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group