Lisp HUG Maillist Archive

change font for some text in a stream or capi:collector-pane ?

I like to log information while my application is running to a capi:collector-pane, which is very convenient!

However, to make logged information more clear, I would like to selectively change colors and/or font weight (e.g.. "bold") for headings in the log.

There is an example program "change-callback.lisp" with code that works if I directly type into a capi:collector-pane, but that is not what I want. I use collector-pane-stream to get the stream and use 'format' to write to the collector-pane's stream while my program is running. Writing to this stream does not trigger the function assigned to :change-callback for a capi:collector-pane.

Can anyone point me to documentation or a relevant code sample?

Mark Watson, consultant and author of 20+ books: https://markwatson.com

It is better to travel well than to arrive. - Buddha

Re: change font for some text in a stream or capi:collector-pane ?

If I recall correctly, a collector pane is a kind of LispWorks editor buffer. Something like (capi:editor-pane-buffer collector-pane) to access it.

You color that using "Font Lock" commands. The editor source is included showing how that is done. A place to start is the command "Font Lock Fontify Block".

John DeSoi, Ph.D.


> On Apr 22, 2020, at 8:48 AM, Mark Watson <markw@markwatson.com> wrote:
> 
> I like to log information while my application is running to a capi:collector-pane, which is very convenient!
> 
> However, to make logged information more clear, I would like to selectively change colors and/or font weight (e.g.. "bold") for headings in the log.
> 
> There is an example program "change-callback.lisp" with code that works if I directly type into a capi:collector-pane, but that is not what I want. I use collector-pane-stream to get the stream and use 'format' to write to the collector-pane's stream while my program is running. Writing to this stream does not trigger the function assigned to :change-callback for a capi:collector-pane.
> 
> Can anyone point me to documentation or a relevant code sample?
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: change font for some text in a stream or capi:collector-pane ?

Unable to parse email body. Email id is 15206

Re: change font for some text in a stream or capi:collector-pane ?

Thanks to John and Martin for help.

write-string-with-properties did the trick, with one caveat: three of the predefined :highlite values (:bold, :italic, :bold-italic) are not implemented on macOS. I don't care about that since the other predefined values work fine.

On Wed, Apr 22, 2020, at 10:40 AM, Martin Simmons wrote:
You might find hcl:write-string-with-properties useful
(http://www.lispworks..com/documentation/lw71/LW/html/lw-714.htm).

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



>>>>> On Wed, 22 Apr 2020 06:48:45 -0700, Mark Watson said:
> 
> I like to log information while my application is running to a capi:collector-pane, which is very convenient!
> 
> However, to make logged information more clear, I would like to selectively change colors and/or font weight (e.g.. "bold") for headings in the log.
> 
> There is an example program "change-callback.lisp" with code that works if I directly type into a capi:collector-pane, but that is not what I want. I use collector-pane-stream to get the stream and use 'format' to write to the collector-pane's stream while my program is running. Writing to this stream does not trigger the function assigned to :change-callback for a capi:collector-pane.
> 
> Can anyone point me to documentation or a relevant code sample?
> 
> Mark Watson, consultant and author of 20+ books: https://markwatson.com
> 
> It is better to travel well than to arrive. - Buddha

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Mark Watson, consultant and author of 20+ books: https://markwatson.com

It is better to travel well than to arrive. - Buddha

Re: change font for some text in a stream or capi:collector-pane ?

Unable to parse email body. Email id is 15209

Updated at: 2020-12-10 08:28 UTC