Re: [ROOT] how to set the cursor?

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Feb 27 2002 - 16:13:53 MET


Hi William,

  do something like:

  Cursor_t waitcursor = gVirtualX->CreateCursor(kWatch);
  gVirtualX->SetCursor(mymain->GetId(), waitcursor);

where mymain is a pointer to your MyMainFrame. Different cursor types
can be found in TVirtualX.h. Of course you would make waitcursor a
datamember of your MyMainFrame and create the waitcursor only once in
the ctor.


Cheers, Fons.



On Tue, 2002-02-26 at 21:26, William Hanlon wrote:
> Hi,
> 
> I have seen this question asked before, but none of the examples
> answer my particular question.
> 
> I have generated a main root window in a stand alone fashion using a
> class derived from TGMainFrame. I would like to set the cursor to
> kWatch during long waits. This main window has several canvases
> in it so using gPad->SetCursor is not the most efficient way to set
> the cursor.
> 
> Is there a way to set the cursor for the entire window? Is something
> like gVirtualX->SetCursor() usable? I can't seem to get the window id
> though.
> 
> I run my program like this:
> 
> class MyMainFrame(const TGWindow *p, UInt_t w, UInt_t h) :
>       public TGMainFrame(p, w, h)
> {
> 
>   // this brings up the main working window 
> 
> 
> }
> 
> int main(...)
> {
> 
> TROOT simple("simple", "display");
> TApplication theApp("theApp", &argc, argv);
> 
> MyMainFrame mf(gClient->GetRoot(), 1200, 800);
> theApp.Run();
> 
> }
> 
> -- 
> William Hanlon                       http://www.physics.rutgers.edu/~whanlon
> Rutgers University                   pgp fingerprint:85 68 43 55 9A 83 44 00
> Dept. of Physics and Astronomy                       CE 19 C0 B0 D9 DE D6 52
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:43 MET