library: libGui #include "TGToolTip.h"

# TGToolTip

class description - source file - inheritance tree (.ps)

## class TGToolTip : public TGCompositeFrame

| Inheritance Chart:

`TObject`

<-

`TGObject`

<-

`TGWindow`

`TQObject`

<-

`TGFrame`

<-

`TGCompositeFrame`

<-

`TGToolTip`

        public:

                          TGToolTip(const TGWindow* p, const TGFrame* f, const char* text, Long_t delayms)
                          TGToolTip(const TGWindow* p, const TBox* b, const char* text, Long_t delayms)
                          TGToolTip(const TBox* b, const char* text, Long_t delayms)
                          TGToolTip(const TGToolTip&)
                  virtual ~TGToolTip()
           static TClass* Class()
             virtual void DrawBorder()
          const TGString* GetText() const
           virtual Bool_t HandleTimer(TTimer* t)
                     void Hide()
          virtual TClass* IsA() const
                     void Reset()
                     void Reset(const TVirtualPad* parent)
                     void SetPosition(Int_t x, Int_t y)
                     void SetText(const char* new_text)
                     void Show(Int_t x, Int_t y)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

                    TGLabel* fLabel   help text
              TGLayoutHints* fL1      layout used to place text in frame
                     TTimer* fDelay   popup delay timer
              const TGFrame* fWindow  frame to which tool tip is associated
          const TVirtualPad* fPad     pad to which tooltip is associated
                 const TBox* fBox     box in pad to which tooltip is associated
                       Int_t fX       X position in fWindow where to popup
                       Int_t fY       Y position in fWindow where to popup

## Class Description

     TGToolTip

     A tooltip is a one line help text that is displayed in a window
     when the cursor rests over a widget. For an example of usage see
     the TGButton class.

TGToolTip(const TGWindow *p, const TGFrame *f, const char *text, Long_t delayms) : TGCompositeFrame(p, 10, 10, kTempFrame | kHorizontalFrame | kRaisedFrame)

     Create a tool tip. P is the tool tips parent window (normally
     fClient->GetRoot(), f is the frame to which the tool tip is associated,
     text is the tool tip one-liner and delayms is the delay in ms before
     the tool tip is shown.

TGToolTip(const TGWindow *p, const TBox *box, const char *text, Long_t delayms) : TGCompositeFrame(p, 10, 10, kTempFrame | kHorizontalFrame | kRaisedFrame)

     Create a tool tip. P is the tool tips parent window (normally
     fClient->GetRoot(), box is the area to which the tool tip is associated,
     text is the tool tip one-liner and delayms is the delay in ms before
     the tool tip is shown. When using this ctor with the box argument
     you have to use Reset(const TVirtualPad *parent).

TGToolTip(const TBox *box, const char *text,Long_t delayms) : TGCompositeFrame(gClient->GetRoot(), 10, 10, kTempFrame | kHorizontalFrame | kRaisedFrame)

     Create a tool tip in the parent window gClient->GetRoot(),
     box is the area to which the tool tip is associated,
     text is the tool tip one-liner and delayms is the delay in ms before
     the tool tip is shown. When using this ctor with the box argument
     you have to use Reset(const TVirtualPad *parent).

~TGToolTip()

     Delete a tool tip object.

void DrawBorder()

     Draw border of tool tip window.

void Show(Int_t x, Int_t y)

     Show tool tip window.

void Hide()

     Hide tool tip window. Use this method to hide the tool tip in a client
     class.

void Reset()

     Reset tool tip popup delay timer. Use this method to activate tool tip
     in a client class.

void Reset(const TVirtualPad *parent)

     Reset tool tip popup delay timer. Use this method to activate tool tip
     in a client class. Use this method for graphics objects drawn in a
     TCanvas, also the tool tip must have been created with the ctor
     taking the TBox as argument.

Bool_t HandleTimer(TTimer *)

     If tool tip delay timer times out show tool tip window.

void SetText(const char *new_text)

     Set new tool tip text.

void SetPosition(Int_t x, Int_t y)

     Set popup position within specified frame (as specified in the ctor).
     To get back default behaviour (in the middle just below the designated
     frame) set position to -1,-1.

const TGString* GetText() const

     Get the tool tip text.

### Inline Functions

                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
              TGToolTip TGToolTip(const TGToolTip&)

Author: Fons Rademakers 22/02/98
Last update: root/gui:$Name: $:$Id: TGToolTip.cxx,v 1.8 2004/04/20 14:48:01 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *