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

From: Mariusz Stanczak (MStanczak@usa.net)
Date: Wed Jan 12 2000 - 01:50:53 MET


On Mon, 10 Jan 2000 19:03:28 -0500, Valeri Fine (Faine) wrote:

>  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 ------------
   Thank you, Valeri, for the suggestion.  The RequestString() works in the
macro above, but I have not made it work yet in my program... the string is
displayed on the canvas, but I cannot edit it and the canvas thread appears
to be locked up.  I call the RequestString() method from within
ExecuteEvent() method of my class.  I suspect the lockup is caused by a loss
of keyboard focus.  When all else fails there's always the console for user
i/o... sigh.

>
>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.
>
   This would be nice, but aren't the new classes Rene spoke of coming to
WinNT?

>                           Valery
>
Thank you for your input,

/Mariusz



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