C notification when named font has changed

36 views
Skip to first unread message

Luc Moulinier

unread,
Jul 22, 2021, 12:21:52 PMJul 22
to
Dear all,

I've created a text matrix widget in C.
I got some problems when using named font. For example, if I change the font size at the Tcl level (font configure MyFont -size 24), my widget does not respond correctly, i.e. the content (number of rows/cols) and scrollbars are badly updated.

K'm assuming that issuing a "font configure MyFont -size 24" at Tcl level will issue a ConfigureNotify at the C level but I'm cretainly wrong ...

What is, at the C level, send to a widget that use a given named font when this font is modified at the Tcl level ?

Many thanks !
Luc

Robert Heller

unread,
Jul 22, 2021, 1:53:37 PMJul 22
to
I don't think you can get any sort of event for a "font configure ..." action.

What *could* happen is you can force an Exposure event (to force a re-draw),
and then as part of that re-compute the character cell size, which would
result in re-computing the number of rows/cols, etc.


>
> Many thanks !
> Luc
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

briang

unread,
Jul 22, 2021, 5:01:24 PMJul 22
to
See the man page for Tk_SetClassProcs()
https://www.tcl.tk/man/tcl8.6/TkLib/SetClassProcs.html

One of the callback procs is worldChangedProc which will be called whenever any font changes in any way. This callback is made for other "global" reasons too.

-Brian

Harald Oehlmann

unread,
Jul 28, 2021, 4:41:11 AMJul 28
to

Am 22.07.2021 um 23:01 schrieb briang:> See the man page for
Tk_SetClassProcs()
> https://www.tcl.tk/man/tcl8.6/TkLib/SetClassProcs.html
>
> One of the callback procs is worldChangedProc which will be called whenever any font changes in any way. This callback is made for other "global" reasons too.
Yes, and it is a long standing wish to bring this callback to the script
level to reconfigure meta-widgets... So much to do...

Thanks,
Harald
Reply all
Reply to author
Forward
0 new messages