TRootGuiBuilder

Greetings,

I’ve been trying to use the gui builder for a real application (Root 5.27 on WinXP). Some issues I’ve been having:

  1. I see there is a TRootGuiBuilder and a TGuiBuilder. What are the differences, and which to use?
    If I execute new TRootGuiBuilder from a root command line, I get two ROOT Gui Builder windows.

  2. Using TGuiBuilder, If I create a control and use the ‘Set Name’ button to give it a new name, save the project, and subsequently re-open that project, the control loses it’s assigned name and gets a new name.
    In fact, all the controls get a new name. I would like to be able to re-open a project and not have new names assigned to the controls.

  3. It would be nice to be able to (re) save a project directly, ie not having to do a ‘save as’, then re-select the same file, then reply yes to allow re-writing it.

Thanks for any help you can give me,
Buddy

Hi Buddy,

[quote]1) I see there is a TRootGuiBuilder and a TGuiBuilder. What are the differences, and which to use?[/quote]TRootGuiBuilder is the real implementation of the TGuiBuilder (global) base class. You have to use “new TGuiBuilder”

[quote]2) Using TGuiBuilder, If I create a control and use the ‘Set Name’ button to give it a new name, save the project, and subsequently re-open that project, the control loses it’s assigned name and gets a new name.
In fact, all the controls get a new name. I would like to be able to re-open a project and not have new names assigned to the controls.[/quote]Weird… I’ll check why it doesn’t work properly and let you know once it’s fixed

[quote]3) It would be nice to be able to (re) save a project directly, ie not having to do a ‘save as’, then re-select the same file, then reply yes to allow re-writing it.[/quote]Sure, I’ll implement it asap

Cheers, Bertrand.

Hi Bertrand,

I tried re-loading and re-saving a gui on root 5.26 on winxp, and i also get the issue of having the controls renamed.

I created a simple gui with just a single frame and button. Attached are 3 files with the built gui source. save1.c was the original creation; save2.c was a re-save of the same project; save3.c was the save that occurred when i closed the gui builder.

Am I missing something basic to have the gui object names preserved?

thanks,
buddy
save3.c (3.55 KB)
save2.c (3.55 KB)
save1.c (3.23 KB)

Hi Buddy,

As I told you, I’ll check what’s going wrong and I’ll let you know as soon as it’s fixed.

Cheers, Bertrand.

Hi buddy,

OK, the problem comes from the way the GUI is saved, and it is not really a bug in the GUI Builder. This is a tricky issue and I will investigate how to solve this. But there will be no quick solution, sorry.

Cheers, Bertrand.

OK Bertrand,

Thanks for your efforts.

Buddy

You’re welcome. I’m actually looking for an elegant solution, but for the time being, if you want to keep the name you gave in your macro, you can still edit the saved macro and add “SetName(“NewName”);” for each frame or widget for which you changed the name, for example:

...
   // embedded canvas
   TRootEmbeddedCanvas *fEmbeddedCanvas001 = new TRootEmbeddedCanvas(0,fHF001,540,443);
   // the following line will make the name "persistent"
   fEmbeddedCanvas001->SetName("fEmbeddedCanvas001");
...

Cheers, Bertrand

Hi buddy,

The renaming problem should be fixed now in svn trunk (by revision 35582). Thanks for the report.

Cheers, Bertrand.

Thanks for the fix. I’ll pick up the head of the tree and try it.

Buddy