Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-04

Caret is not blinking in Unix

11 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 14 lines
Previously I have sent the following message : http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html A help is really appreciated very much . On TcustomControl canvas covering all of the form client area , the caret is NOT blinking in Unix ( FreeBSD , Fedora ( 17 , 18 ) ) , but it is blinking in Windows . Lazarus is installed and used as it is without any change . What can be done to make the caret blinking in Unix ?

On WIndows the caret is drawn by the OS. This includes hiding it. On windows (afaik) this is done by inverting pixel colors. Neither drawing, nor hiding does require the Control to paint.

AFAIK on linux, the caret is drawn by the Widgetsetcode provided by Lazarus. And hiding the caret, is done by invalidating the area, and therefore only effective, if the control repaints itself.

I do not know what goes wrong in your case, but here are some pointers:
- Check that your control receives regular paint messages, and that it does actually paint the area. (It will get a paint messages for a small clip rect only, and must paint into that clip rect.
- If no paint messages are received I have no idea, but maybe it is timer related (I haven't looked that deep, but I guess the caret is triggered by a timer.

Reply by email

Mehmet Erol Sanliturk
to Martin

On each key press , the pressed character appears on the form area , but caret is not blinking even one time .

Thank you very much .

Mehmet Erol Sanliturk

Martin wrote 43 lines
On 05/04/2013 12:04, Mehmet Erol Sanliturk wrote: > > Previously I have sent the following message : > > http://lists.lazarus.**freepascal.org/pipermail/** > lazarus/2013-March/079951.html<http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html> > > A help is really appreciated very much . > On TcustomControl canvas covering all of the form client area , the caret > is NOT blinking in > Unix ( FreeBSD , Fedora ( 17 , 18 ) ) , but it is blinking in Windows . > > Lazarus is installed and used as it is without any change . > > What can be done to make the caret blinking in Unix ? > On WIndows the caret is drawn by the OS. This includes hiding it. On windows (afaik) this is done by inverting pixel colors. Neither drawing, nor hiding does require the Control to paint. AFAIK on linux, the caret is drawn by the Widgetsetcode provided by Lazarus. And hiding the caret, is done by invalidating the area, and therefore only effective, if the control repaints itself. I do not know what goes wrong in your case, but here are some pointers: - Check that your control receives regular paint messages, and that it does actually paint the area. (It will get a paint messages for a small clip rect only, and must paint into that clip rect. - If no paint messages are received I have no idea, but maybe it is timer related (I haven't looked that deep, but I guess the caret is triggered by a timer. -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/ef6c2189/attachment.html>

Reply by email

Martin
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote
On each key press , the pressed character appears on the form area , but caret is not blinking even one time .

Well the below is all I know. You may have to debug it yourself.

Only other think that comes to mind (but IIRC that is mainly required for windows)) is that you need to hide the caret at the start of your paint handler, and show it again at the end of the pain handler. Also do not Create a new caret in the paint handler (again Windows).

Does it blink in the IDE? Then you can try and look at SynEdit to find out how it is done there. (Search FScreenCaret).

Show quoted text 28 lines
On Fri, Apr 5, 2013 at 4:14 AM, Martin < <mailto:>> wrote: On 05/04/2013 12:04, Mehmet Erol Sanliturk wrote: What can be done to make the caret blinking in Unix ? On WIndows the caret is drawn by the OS. This includes hiding it. On windows (afaik) this is done by inverting pixel colors. Neither drawing, nor hiding does require the Control to paint. AFAIK on linux, the caret is drawn by the Widgetsetcode provided by Lazarus. And hiding the caret, is done by invalidating the area, and therefore only effective, if the control repaints itself. I do not know what goes wrong in your case, but here are some pointers: - Check that your control receives regular paint messages, and that it does actually paint the area. (It will get a paint messages for a small clip rect only, and must paint into that clip rect. - If no paint messages are received I have no idea, but maybe it is timer related (I haven't looked that deep, but I guess the caret is triggered by a timer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/ea8aca0c/attachment.html>

Reply by email

Mehmet Erol Sanliturk
to Martin: Well the below is all I know. You may have to debug it yourself. Only other think that…
Martin wrote 46 lines
On 05/04/2013 12:20, Mehmet Erol Sanliturk wrote: On each key press , the pressed character appears on the form area , but caret is not blinking even one time . Well the below is all I know. You may have to debug it yourself. Only other think that comes to mind (but IIRC that is mainly required for windows)) is that you need to hide the caret at the start of your paint handler, and show it again at the end of the pain handler. Also do not Create a new caret in the paint handler (again Windows). Does it blink in the IDE? Then you can try and look at SynEdit to find out how it is done there. (Search FScreenCaret). On Fri, Apr 5, 2013 at 4:14 AM, Martin wrote: > On 05/04/2013 12:04, Mehmet Erol Sanliturk wrote: > >> >> What can be done to make the caret blinking in Unix ? >> > > On WIndows the caret is drawn by the OS. This includes hiding it. On > windows (afaik) this is done by inverting pixel colors. Neither drawing, > nor hiding does require the Control to paint. > > AFAIK on linux, the caret is drawn by the Widgetsetcode provided by > Lazarus. And hiding the caret, is done by invalidating the area, and > therefore only effective, if the control repaints itself. > > I do not know what goes wrong in your case, but here are some pointers: > - Check that your control receives regular paint messages, and that it > does actually paint the area. (It will get a paint messages for a small > clip rect only, and must paint into that clip rect. > - If no paint messages are received I have no idea, but maybe it is timer > related (I haven't looked that deep, but I guess the caret is triggered by > a timer. > --

Lazarus IDE caret is blinking very well .

Previously I had searched SynEdit sources , but I could not find any place to study .

During next days I will search your suggested phrase .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/94ab8ba2/attachment.html>

Reply by email

Mehmet Erol Sanliturk
to zeljko: Find gtkrc file and set caret to blinking. It's by default set to false from some gtk2…
zeljko wrote 21 lines
On 04/05/2013 01:04 PM, Mehmet Erol Sanliturk wrote: > Dear All , > > > Previously I have sent the following message : > > http://lists.lazarus.**freepascal.org/pipermail/** > lazarus/2013-March/079951.html<http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html> > > A help is really appreciated very much . > > Thank you very much . > Find gtkrc file and set caret to blinking. It's by default set to false from some gtk2 version on some distributions. z.

I have searched "gtkrc" in Fedora 17 . There are a large number of "gtkrc" files associated with applications .

In FPC sources , there are gtkrc.pp , and gtkrc.inc , but not gtkrc . Also in Lazarus and fpc there is no gtkrc file .

Which file I should try to modify without breaking the other gtkrc related applications ?

Or , if I copy a gtkrc file to a known directory and modify it , can it be used in that way ?

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/ae52e58c/attachment.html>

Reply by email

zeljko
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 39 lines
On Fri, Apr 5, 2013 at 4:37 AM, zeljko < <mailto:>> wrote: On 04/05/2013 01:04 PM, Mehmet Erol Sanliturk wrote: Dear All , Previously I have sent the following message : http://lists.lazarus.__freepascal.org/pipermail/__lazarus/2013-March/079951.html <http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html> A help is really appreciated very much . Thank you very much . Find gtkrc file and set caret to blinking. It's by default set to false from some gtk2 version on some distributions. z. I have searched "gtkrc" in Fedora 17 . There are a large number of "gtkrc" files associated with applications . In FPC sources , there are gtkrc.pp , and gtkrc.inc , but not gtkrc . Also in Lazarus and fpc there is no gtkrc file . Which file I should try to modify without breaking the other gtkrc related applications ? Or , if I copy a gtkrc file to a known directory and modify it , can it be used in that way ?

it's theme configuration file used by gtk2. Maybe it's named gtk2rc or maybe you have it in your $HOME as .gtkrc or .gtk2rc

z.

Reply by email

zeljko
to Mehmet Erol Sanliturk: I have searched "gtkrc" in Fedora 17 . There are a large number of "gtkrc" files…
Mehmet Erol Sanliturk wrote 39 lines
On Fri, Apr 5, 2013 at 4:37 AM, zeljko < <mailto:>> wrote: On 04/05/2013 01:04 PM, Mehmet Erol Sanliturk wrote: Dear All , Previously I have sent the following message : http://lists.lazarus.__freepascal.org/pipermail/__lazarus/2013-March/079951.html <http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html> A help is really appreciated very much . Thank you very much . Find gtkrc file and set caret to blinking. It's by default set to false from some gtk2 version on some distributions. z. I have searched "gtkrc" in Fedora 17 . There are a large number of "gtkrc" files associated with applications . In FPC sources , there are gtkrc.pp , and gtkrc.inc , but not gtkrc . Also in Lazarus and fpc there is no gtkrc file . Which file I should try to modify without breaking the other gtkrc related applications ? Or , if I copy a gtkrc file to a known directory and modify it , can it be used in that way ?

But if caret works in lazarus ide editor then it's not because of gtk2 theme config. Afair I've fixed caret blinking > 2 yrs ago in gtk2 (overrides theme) so it blinks always.

Reply by email

Mehmet Erol Sanliturk
to zeljko
zeljko wrote 52 lines
On 04/05/2013 02:02 PM, Mehmet Erol Sanliturk wrote: > > > > On Fri, Apr 5, 2013 at 4:37 AM, zeljko < > <mailto:>> wrote: > > On 04/05/2013 01:04 PM, Mehmet Erol Sanliturk wrote: > > Dear All , > > > Previously I have sent the following message : > > http://lists.lazarus.__freepas**cal.org/pipermail/__lazarus/** > 2013-March/079951.html<http://freepascal.org/pipermail/__lazarus/2013-March/079951.html> > <http://lists.lazarus.**freepascal.org/pipermail/** > lazarus/2013-March/079951.html<http://lists.lazarus.freepascal.org/pipermail/lazarus/2013-March/079951.html> > **> > > A help is really appreciated very much . > > Thank you very much . > > > Find gtkrc file and set caret to blinking. It's by default set to > false from some gtk2 version on some distributions. > > z. > > > > I have searched "gtkrc" in Fedora 17 . There are a large number of > "gtkrc" files associated with applications . > > In FPC sources , there are gtkrc.pp , and gtkrc.inc , but not gtkrc . > Also in Lazarus and fpc there is no gtkrc file . > > Which file I should try to modify without breaking the other gtkrc > related applications ? > > Or , if I copy a gtkrc file to a known directory and modify it , can it > be used in that way ? > But if caret works in lazarus ide editor then it's not because of gtk2 theme config. Afair I've fixed caret blinking > 2 yrs ago in gtk2 (overrides theme) so it blinks always.

( 1 ) :

In Home directory :

.gtkrc-2.0-kde4 :

Contents :

--------------
include "/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc" include "/etc/gtk-2.0/gtkrc"

gtk-theme-name="oxygen-gtk"
--------------

"/etc/gtk-2.0/gtkrc" : No caret information , but there is line : gtk-cursor-theme-name = "Adwaita"

"/usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc" : No caret information

( 2 )

Perhaps , it is necessary to set some property / variable in my program related to form definition /creations , but which one I do not know .

For example , in Delphi , OutText is opaque , but in Lazarus it was transparent because a variable was set to False as default . When that variable is set to True , Lazarus compiled OutText started to write opaque also .

There may be such a variable , but what and where it is , I do not know .

I tried to find such a variable in SynEdit , but , SynEdit is very complicated , and I am not using any part of it , and also I do not know its internals .

Lazarus is setting that variable ( unknown to me ) that it is blinking the caret .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20130405/9b0618da/attachment.html>

Reply by email

Martin
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote 9 lines
There may be such a variable , but what and where it is , I do not know . I tried to find such a variable in SynEdit , but , SynEdit is very complicated , and I am not using any part of it , and also I do not know its internals . Lazarus is setting that variable ( unknown to me ) that it is blinking the caret .

SynEdit sets no variable.

The entire caret stuff is wrapped in the class TSynEditScreenCaret. You can see all the system/lcl/widgetset calls there.

As I said: Verify your paint handler is called every few seconds. Even if you do nothing (put a writeln in there, and run from console). Verify your paint handler handles cliprect

Reply by email