Re: kButtonX processing, Root 2.23/10, WinNT 4

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Tue Jan 11 2000 - 01:03:28 MET


  This lower-lever method:

   virtual Int_t     TVirtualX::RequestString(Int_t x, Int_t y, char *text);

  allow you to display and change any text on your screen:

--------- Cut here ------------
{
  #include "iostream.h" 
  new TCanvas("cc");
  char label[100] = " label to display      ";
  cout << label << endl;
  gVirtualX->RequestString(10, 20, label);
  cout << label << endl;
}
--------- Cut here ------------

May be to get the several lines you should combine the method above with
TVirtualX::DrawText(); or with TText 

  I mean first you should draw all lines of the text you want to be present and then 
  call  "RequestString()"  in respect of the current cursor position to change the 
  line your cursor is nearby. (somewhere within TObject::ExecuteEvent() method
  of your class)
  
 May be it is not too elegant but may solve your problem. I believe the code you will 
 write will be not bigger that with any MFC / Motif and Co.

  The better solution would be to call gVirtualX->RequestString() by TText::ExecuteEvent 
   responding on "left - mouse click". (TPaveLabel::ExecuteEvent() etc )

  This way the end-user code will need no extra trick at all. May be ROOT team can provide
   this.

                           Valery



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:16 MET