Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGIdleHandler.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 2/8/2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13/** \class TGIdleHandler
14 \ingroup guiwidgets
15
16Handle idle events, i.e. process GUI actions when there is nothing
17else anymore to do.
18
19*/
20
21
22#include "TGIdleHandler.h"
23#include "TGWindow.h"
24
25
27
28////////////////////////////////////////////////////////////////////////////////
29/// Create idle handler.
30
32{
33 if (w) {
34 fWindow = w;
35 if (fWindow->GetClient())
37 } else
38 Error("TGIdleHandler", "window cannot be 0");
39}
40
41////////////////////////////////////////////////////////////////////////////////
42/// Delete idle handler.
43
45{
46 if (fWindow && fWindow->GetClient())
48}
49
50////////////////////////////////////////////////////////////////////////////////
51/// Handle the idle event. Returns true if the event has been handled,
52/// false otherwise.
53
55{
56 return (fWindow) ? fWindow->HandleIdleEvent(this) : kFALSE;
57}
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassImp(name)
Definition Rtypes.h:382
void AddIdleHandler(TGIdleHandler *h)
Add handler for idle events.
Definition TGClient.cxx:573
void RemoveIdleHandler(TGIdleHandler *h)
Remove handler for idle events.
Definition TGClient.cxx:586
Handle idle events, i.e.
TGIdleHandler(TGWindow *w)
Create idle handler.
virtual Bool_t HandleEvent()
Handle the idle event.
TGWindow * fWindow
~TGIdleHandler() override
Delete idle handler.
TGClient * GetClient() const
Definition TGObject.h:42
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual Bool_t HandleIdleEvent(TGIdleHandler *)
Definition TGWindow.h:105
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:993