Adding predefined functions to my GUI

Hello Rooters,

I recently wrote a GUI interface and thus far I have been defining and coding all of my own functions for drop down menus and such. However I was wondering if there was a way to use the functions from TPad such as SaveAs and Open, without recoding them myself. I was thinking that this could be done through inheritance but I am unsure of how to do it, as I am not nearly a C++ expert.

If this question has already been asked sorry for being redundant, but I was unable to find documentation on this. Also an example of code that does this would be very useful but not nessasary.

Cheers,
Paul

You do not need to derive from TPad to use the TPad functions.
If you have a TPad* pad object, you can always call
pad->SaveAs(…

Rene

Thank you for your prompt reply, However, I was wondering if you could derive the entire menu bar, rather than just call certain functions. for example when you create a TCanvas it gives a TPad window with a canvas in it and on the top there is a menu bar with certain options and such built in. However when you call an embedded canvas for a gui interface you do not get this menu bar rather you have to define your own. This is a useful function and is one of the reasons that I switched to a custom GUI however my boss also wants the old functionality of the TCanvas window in the GUI I created and I was wondering if I could call the entire menu bar and add it to my windows or if I would have to recreate the entire thing.

Thanks again,
Paul

Hi Paul,
try GUI Builder.
root.cern.ch/root/htmldoc/TGuiBuilder.html

“Borrow” :wink: (drag and drop) menu bar from TCanvas
into your GUI. Actually you can put the whole TCanvas into
your GUI :smiley:

Regards. Valeriy

Thanks it sounds like a very useful tool, does it come standard with root I believe I am currently running ROOT 3 version, is this a new feature in ROOT 4? or can it be downloaded seperatly. If it is in ROOT 3 how do I acess it?

Thanks
Paul

Hi,
yes it’s new, currently under development.
First appeared in
root.cern.ch/root/Version40102.news.html
So, it’s still buggy, nevertheless very usefull. For example,
it’s used for development GUI Builder itself :smiley:

Regards. Valeriy