Re: TButton

Rene Brun (Rene.Brun@cern.ch)
Thu, 15 May 1997 17:06:30 +0200


Grave Xavier wrote:
>
> Hello,
>
> I'm trying to use the TButton Class to make a data display.
> Can somebody send me a simple example :
> a canvas + a button.
> when you click the button you get "toto" in the standard outpout.
>

Xavier,
You can generate yourself an example.
For example, if you have a canvas, TPaveLabel, etc on your screen,
select SetFillAttributes. This will show you a DialogCanvas
with buttons. You can generate the macro/code corresponding
to this special canvas by clicking anywhere in this DialogCanvas,
with the right mouse button (except on one button of course)
and select the Print menu. In The dialog box, type a filename
(say att.C). att.C wll contain real working code showing examples
with buttons.
The same technique can be used to see how DrawPanel, FitPanel
with buttons and sliders are used.
You can also look at the way buttons are used in Root itself.
For example, see:
http://root.cern.ch/root/html/TAttFillCanvas.html
and view the source code of the TAttFillCanvas constructor.

Rene Brun