Forum > LCL
lclintf.caret not shown in Linux
(1/1)
Martin V:
Hello,
has anyone successfully used the lclintf caret implementation in Linux? (A caret is a blinking cursor.) A simple test program based on a simple form with two buttons for creating and destroying a caret is this:
--- Code: ---procedure TForm1.Button1Click(Sender: TObject);
begin
lclintf.CreateCaret(Handle,0,15,5);
lclintf.SetCaretPosEx(Handle,150,100);
// alternatively lclintf.SetCaretPos (150,100);
lclintf.ShowCaret(Handle);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
lclintf.HideCaret(Handle);
lclintf.DestroyCaret(Handle);
end;
--- End code ---
In Win32, the code works fine, in MacOSX, it also works, but in Linux (Ubuntu), the caret is not shown.
P.S. In MacOSX, it seems that the Y coordinate in SetCaretPos has to be ClientHeight-Y, I will report that in the bugtracker.
Martin
Martin V:
I have reported the bug in the bugtracker now and will report the results here later.
Martin
Marc:
The caret is a special "thing" on gtk and needs to be handled on a per widget basis. So it won't set a caret on any random widget.
(since a form doesn't have a caret natively, chances are low that it will be implemented, unless somebody provides a patch)
Martin V:
Hello,
I got feedback (bugtracker 0016746) and the result is, that in gtk2 the Caret does not accept a tForm where it resides. A tCustomControl with Align := alClient fills the whole form client area and this object can store the Caret which works fine there.
The Y coordinate problem was a false alarm, I had an additional conversion in my program which produced the false Y values.
Martin
Navigation
[0] Message Index