Hi Kirill,
I am not sure I completely understand what you mean. Note that you can
connect as many signals to a single slot as you want. So PositionChanged(Int_t)
can be connected to more than one slot. Also you can find out the slider
that was the sender using the gQTSender global object
(see $ROOTSYS/tutorials/guitest.C) so you don't need to keep a pointer of the
slider in your class since you can retrieve it via gQTSender in the slot method.
Cheers, Fons.
Kirill Shileev wrote:
>
> Hi Brett
>
> I meant a bit different thing. DoSlider is just another level of
> complication. It's hand-written code which belongs to guivewer.cxx.
> My program is doing it exactly the same way. What i'm looking for is more
> simple solution. Imagine if TGLabel or TGComboBox have a methods which
> accept Int_t and convert it to string internally. This allows to get rid
> of the necessity of another layer in code like DoSlider. You just connect
> PositionChanged to your function responsible for the actual hardware
> action and to the above mentioned method of TGLabel. This also implies you
> do not need to keep the pointer to TGSlider wiget as a field of your
> class. I thought this facility must be there, as it's pretty natural to
> have it. Say Qt has it.
>
> Rene&Fonts, if it's not true is there any hope to have it in furture?
>
> Regards, Kirill
>
> On Tue, 22 May 2001, Brett Viren wrote:
>
> > Kirill Shileev writes:
> > > pVerticalSlider->Connect("PositionChanged(Int_t)","TGLabel",pLabel,"What should be here???");
> >
> > You can look at root/test/guiviewer.cxx for an example which connects
> > a slider to a TGaxis and a TCanvas's range. In that case, ``what
> > should be here???'' is the name of the method: ``DoSlider''.
> >
> > -Brett.
> >
--
Org: CERN, European Laboratory for Particle Physics.
Mail: 1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248
WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET