On Sun, 3 Jun 2007 09:11:06 +1000, "Neil Hodgson"
<[EMAIL PROTECTED]> wrote:
> Enrico Tröger:
>
> > But isn't it anyway a good idea to read the GTK blink time setting
> > and use it in the GTK part of Scintilla? So, Scintilla based apps
> > behave by default like apps using GtkTextViews or GtkEntries. The
> > value could remain changeable by the SCI_SETCARETPERIOD message.
>
> I'll accept a patch. It should run early in widget creation before
> the container can call SCI_SETCARETPERIOD.
The attached patch reads gtk-cursor-blink and gtk-cursor-blink-time and
sets caret.period. Because GTK and Scintilla use the given time
different(GTK shows the caret for the given time, then hides shortly
and shows it again), I tried to compensate this by using a factor of
1.75 to the GTK value. Maybe, this factor could be optimised.
What do you think?
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.key
Index: gtk/ScintillaGTK.cxx
===================================================================
RCS file: /cvsroot/scintilla/scintilla/gtk/ScintillaGTK.cxx,v
retrieving revision 1.176
diff -r1.176 ScintillaGTK.cxx
784a785,802
> // set caret period based on GTK settings
> gboolean blinkOn;
> if (g_object_class_find_property(G_OBJECT_GET_CLASS(
> G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink")) {
> g_object_get(G_OBJECT(
> gtk_settings_get_default()), "gtk-cursor-blink", &blinkOn, NULL);
> }
> if (blinkOn &&
> g_object_class_find_property(G_OBJECT_GET_CLASS(
> G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink-time")) {
> gint value;
> g_object_get(G_OBJECT(
> gtk_settings_get_default()), "gtk-cursor-blink-time", &value, NULL);
> caret.period = gint(value / 1.75);
> }
> else
> caret.period = 0;
>
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest