Re: [ROOT] GUI questions (related to Dialog) - bug in macro?

From: cstrato@EUnet.at
Date: Fri Aug 10 2001 - 22:59:01 MEST


Dear Brett, dear Rooters

Thank you Brett for a first answer, I could now implement TGTableLayout.

I am looking forward to the other answers and have ONE more question:

In running my macro gui1.C, when I press the "Browse" button, the
TGFileDialog box opens. However, when I select something and press
the "Open" button, ROOT presents a "***Break*** segmentation violation"
error, although I can continue with the macro.

Can anybody tell me what kind of mistake is in function "FBrowse()"?

Thank you
Christian



Brett Viren wrote:

> cstrato@EUnet.at writes:
>  > 1, Memory leaks:
>  > In line 84 I use the following code, similar to code found in guitest.C:
>  >
>  >    fFrameInfo->AddFrame(new TGLabel(fFrameInfo,new TGString("Last
>  > Name")),
>  >                       new TGLayoutHints(kLHintsTop | kLHintsLeft));
>  > Here TGLabel, TGString and TGLayoutHints are created within a function,
>  > but never explicitely deleted. Does this result in memory leaks when the
>  > dialogbox will be closed, or will these objects be deleted
>  > automatically?
>
> Yes.  See how test/guitest.cxx uses fCleanup for an easy way to handle
> these objects.
>
>  > 2, TGGroupFrame "Author Info":
>  > Here I use TGMatrixLayout which results in a large distance between
>  > TGLabel
>  > and TGTextEntry. Is there a better way to implement it?
>  > Could I use TGTableLayout, and how do I need to implement this?
>
> Yes, TGTableLayout might be better.  It decides the row and column
> widths based on the largest vertical and horizontal dimension,
> respectively, of the elements.  You can also have an element span more
> than one column/row.  See test/guiviewer.{cxx,h} for an example of how
> to use this.
>
> Can't help you on the rest, but looking forward to hearing the
> answers.
>
> -Brett.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET