Re: Canvas::ToolBar,(mainmenu)

Rene Brun (Rene.Brun@cern.ch)
Tue, 15 Dec 1998 15:55:29 +0100


Grigory Trubnikov wrote:
>
> Dear ROOT Developers !
> I'm only beginner in the ROOT, and want to create some application for
> my physic tasks.
> For about 3-4 days I tryed to find out in "ROOT System manual" how I
> can change the default ToolBar (main menu) of ROOT canvas to my own
> style (which I wanted : with my popups and titles), but I couldn't find
> the source text (listing) of this. I don't know how I can call
> Canvas::ToolBar (if such ever exists...) ?
> May be you'll help me in my problems?
> Sincerely yours,
> Grigory Trubnikov.

Hi Grigory,
If you are a beginner with Root, I would strongly suggest that
you do not start modifying the canvas standard toolbar.
There are better solutions:
- Create your own classes and declare your member functions
visible in the context menu. To do that, simply add the comment
string // *MENU * after the member function declaration on the
same line (see examples in Root classes, eg, TPad, TCanvas).
When you draw an object of your class in the canvas, you can click
with the right button to get the context menu for this object.
(see also http://root.cern.ch/root/HowtoDraw.html and HowtoPick.html
- Create a TControlBar
- See example program in $ROOTSYS/test/guitest

Rene Brun