Re: [ROOT] TGListView::DoubleClicked() problem

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Thu Jan 10 2002 - 17:53:33 MET


Hi Bertalan,

    make sure that after creating the TGLVContainer you associate
the container with the TGListView. In that case the container
events are properly propagated to the TGListView and things should work.
Example:

    fListView = new TGListView(fV2, 520, 250);
    fIconBox = new TGLVContainer(fListView->GetViewPort(), 520, 250,
                                 kHorizontalFrame, fgWhitePixel);
    fIconBox->Associate(this);


We are well aware of the lacking manual and we will fix this in
the coming months.


Cheers, Fons.




Bertalan Juhasz wrote:

> Dear Rooters,
> 
> I'm developing some GUI classes and I've encountered the following
> problem: even if I connect TGListView::DoubleClicked() to one of my slot
> functions using
> 
> fFileView->Connect("DoubleClicked(TGLVEntry*, Int_t)", "PbarFileBrowser",
> this, "HandleBrowser(TGLVEntry*, Int_t)");
> 
> the HandleBrowser() function is never called when I double click on an
> item although ROOT is not complaining about wrong signal/slot connection.
> Was I doing something wrong? After digging into and playing with the ROOT 
> code I've discovered that HandleBrowser() is never called because
> TGListView::DoubleClicked() is never called, only
> TGLVContainer::HandleDoubleClick(). After I've added the following lines
> to TGLVContainer::HandleDoubleClick()
> 
> if (fListView) fListView->DoubleClicked(f, event->fCode);
> if (fListView) fListView->DoubleClicked(f, event->fCode, event->fXRoot,
> event->fYRoot);
> 
> right after SendMessage(...) (similarly to TGTreeView) everything worked
> fine but maybe this is a dirty/illegal solution (I'm completely new to GUI
> programming). Most likely TGListView::Clicked() has similar problems but
> that I didn't investigate.
> 
> I'm using ROOT 3.02/06 with RedHat 7.2.
> 
> BTW, are there plans to write some User's Guide on GUI programming? For
> those how never did anything like that before (like myself) it's a bit
> painful (and dangerous) to learn just by digging through example codes
> (although those codes are quite nice).
> 
> Regards,
> 
> Bertalan
> 
> 
> 
> 


-- 
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 7679480



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:37 MET