[ROOT] GUI problems.

From: FLOOR STEPHEN NICHOLAS (snfloor@falcon.cc.ukans.edu)
Date: Mon Oct 16 2000 - 00:17:54 MEST


Hello folks, I've been having some troubles with implementing a root-based
gui program.  The program is quite large at this point so it's relatively
hard to track down the segmentation faults that occur.  What tracking
down I have been able to do has pointed to problems in the ROOT class
destructors, namely GUI_RootCanvas.cxx, GUI_GMenu.cxx, GUI_GFrame.cxx and 
quite a few other GUI related classes.  I am quite certain, however, that 
it is my implementation (not the original code) that is causing the
problems.  I have some questions that will help me to get on
the right track.  The main function of the program is to run a GUI that
has buttons which open a new window containing data.  These buttons work
fine.  Inside one of the 'subwindows' there are buttons to open a second
subwindow.  It is at the closing of this second subwindow that the
problems occur.  

Questions:

1)  Is it required to define the menubar for a canvas?  If so, what is the
functionality of the Associate function?  Is this function required?  If
so, what should be passed to it if the class does not inherit from
TGMainFrame?

2) The reason behind the first question yields the second.  I receive
segmentation faults from the program when the 'x' is pressed in the corner
to close the window (also when you hit alt-f4 or choose close from the
menu).  CloseWindow (and a relevant destructor) is defined for all the
classes involved, but they do not inherit from TGMainFrame or utilize
TGMainFrame.  Is this required?  I notice that it was used in the
Guitest.cxx example...

3) What is the functionality of TGMainFrame?  Would using TGMainFrame and
TRootEmbeddedCanvas be the best approach for a multi-window program, or
would TCanvas work better?  If TRootEmbeddedCanvas is better, what
functions are there to replace TCanvas->cd(int_t) and TCanvas->Update()?

3b) What is the function of TRootEmbeddedCanvas->AdoptCanvas(TGWindow *)?
Can this function be used to hold pointers as discussed in #4?

4) How do multi-layered TCanvas's talk to each other?  Is there a pointer
which keeps track of the 'parent' TCanvas?  Is there a function to assign
this pointer?

Answers to all or even some of these questions I believe would solve the
problem.  I have not attached code because it is quite lengthly but can do
in a future message if the need arises.

Any help is greatly appreciated - reply to roottalk or snfloor@ukans.edu.
Thanks!

-Stephen Floor



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET