Re: [ROOT] Scrolling it (TGListTree) down #2 ...

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Mon Sep 11 2000 - 11:47:15 MEST


Hi Anton,

 finally a solution for this problem. I've implemented in TGCanvas the
methods: SetVsbPosition() and SetHsbPosition() which allow you to do
what you want:

fMessageView->SetVsbPosition(fMessageView->GetContainer()->GetHeight());


Available from CVS and later in the week as binary.


-- Fons



FOKIN@tsl.uu.se wrote:
> 
> Hi rooters,
> 
> I am a bit lost view GUI viewport and its behaviour. What I want to doo add
>  an item
> (message) in a ListTree and then scroll down to the last message in the ist. Co
> uld you
> suggest a few good lines for the code below? My commented lines doesn't work for
>  me ...
> 
> Regards,
> Anton
> 
>   Constructor
> 
> -----------------------------
> 
> // Messagame
> 
>   fMessageFrame = AddTab("Message");
> 
>   fMessageView      = new TGCanvas(fMessageFrame, 125, 100, kSunkenFrameoub
> leBorder);
>   fMessageListTree  = new TGListTree(fMessageView->GetViewPort(), 100, 100, kHor
> izontalFrame, fgWhitePixel);
> 
>   fMessageListTree->Associate(this);
> 
>   fMessageView->SetContainer(fMessageListTree);
> 
>   fMessageFrame->AddFrame(fMessageView, new TGLayoutHints(kLHintsTop | kLHintsLe
> ft | kLHintsExpandX | kLHintsExpandY));
> 
> ----------------------------
> 
>   Add message
> 
>   Item = fMessageListTree->AddItem(0, Entry, gClient->GetPicture("forward.xpm"),
>  gClient->GetPicture("forward.xpm"));
> 
>   fMessageListTree->HighlightItem(Item);
> 
> //  ((TGViewPort*)fMessageView->GetViewPort())->SetPos(???,???);
> //  Lay);
> 
> //  fMessageView->Move(???,???);
> 
>   fClient->NeedRedraw(fMessageListTree);

-- 
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 02 2001 - 11:50:32 MET