Accessing a widget in a TabControlComposite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing a widget in a TabControlComposite

Damien Cassou-3-2
Hi,

I'm new to VisualWorks and I would like to access a widget
programmatically.

In fact, I've just added a list (ID: #classTypeList) at the bottom of
the ClassCreationDialog. How can I access the widget #classTypeList from
a method in ClassCreationDialog ?


Thank you


--
Damien

Reply | Threaded
Open this post in threaded view
|

Re: Accessing a widget in a TabControlComposite

Rob Vens
self widgetAt: #classTypeList
this returns the widget. If you want the wrapper, for example to
enable or disable the widget, you need to send:
self wrapperAt: #classTypeList

2006/6/9, Damien Cassou <[hidden email]>:

> Hi,
>
> I'm new to VisualWorks and I would like to access a widget
> programmatically.
>
> In fact, I've just added a list (ID: #classTypeList) at the bottom of
> the ClassCreationDialog. How can I access the widget #classTypeList from
> a method in ClassCreationDialog ?
>
>
> Thank you
>
>
> --
> Damien
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Accessing a widget in a TabControlComposite

Damien Cassou-3-2
Rob Vens a écrit :
> self widgetAt: #classTypeList
> this returns the widget. If you want the wrapper, for example to
> enable or disable the widget, you need to send:
> self wrapperAt: #classTypeList
In fact, it would have been too easy. My widget is not directly here. It
is in a TabControlComposite.

Here are the components I can access from the ClassCreationDialog:

IdentityDictionary (#okButton->a SpecWrapper on: a BoundedWrapper on: a
WinXPActionButtonView #cancelButton->a SpecWrapper on: a BoundedWrapper
on: a WinXPActionButtonView #tabControl->a SpecWrapper on: a
BoundedWrapper on: a TabControlComposite )


Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Accessing a widget in a TabControlComposite

Ladislav Lenart
Damien Cassou wrote:

> Rob Vens a écrit :
>
>> self widgetAt: #classTypeList
>> this returns the widget. If you want the wrapper, for example to
>> enable or disable the widget, you need to send:
>> self wrapperAt: #classTypeList
>
> In fact, it would have been too easy. My widget is not directly here. It
> is in a TabControlComposite.
>
> Here are the components I can access from the ClassCreationDialog:
>
> IdentityDictionary (#okButton->a SpecWrapper on: a BoundedWrapper on: a
> WinXPActionButtonView #cancelButton->a SpecWrapper on: a BoundedWrapper
> on: a WinXPActionButtonView #tabControl->a SpecWrapper on: a
> BoundedWrapper on: a TabControlComposite )

I presume that you added #classTypeList to windowSpec other than #windowSpec
(to one of #advancedSpec, #detailsSpec, ...). In that case, you should find your
widget in namedComponenets of lastSubBuilder instance variable of ClassCreationDialog:
ClassCreationDialog>>someMethod
        "You can send this *after* build phase (in #postBuildWith: or later).
        | wrapper |
        wrapper := lastSubBuilder componentAt: #classTypeList.
        wrapper ifNotNil: [wrapper widget doSomething].

The test is useful when the selected tab does not contain #classTypeList.

Hope this helps,

Ladislav Lenart

Reply | Threaded
Open this post in threaded view
|

Re: Accessing a widget in a TabControlComposite

Damien Cassou-3-2

>>> self widgetAt: #classTypeList
>>> this returns the widget. If you want the wrapper, for example to
>>> enable or disable the widget, you need to send:
>>> self wrapperAt: #classTypeList
>> In fact, it would have been too easy. My widget is not directly here. It
>> is in a TabControlComposite.
> I presume that you added #classTypeList to windowSpec other than
> #windowSpec
> (to one of #advancedSpec, #detailsSpec, ...). In that case, you should
> find your
> widget in namedComponenets of lastSubBuilder instance variable of
> ClassCreationDialog:
> ClassCreationDialog>>someMethod
>     "You can send this *after* build phase (in #postBuildWith: or later).
>     | wrapper |
>     wrapper := lastSubBuilder componentAt: #classTypeList.
>     wrapper ifNotNil: [wrapper widget doSomething].
>
> The test is useful when the selected tab does not contain #classTypeList.

Thank you very much. It works now.