frang75/nappgui_src

Cannot Set Default Font For Empty TextView

Closed this issue · 5 comments

Hi @frang75 ,
Thanks for this great library.
I am trying out the TextView control. It seems it isn’t possible to set default font for an empty TextView. I set the font using textview_family and textview_fsize and typed some texts using the keyboard but these settings didn’t have any effect. Likewise, I found out that textview_fsize, textview_afspace and textview_lspacing didn’t work for an empty TextView either.

I would really appreciate how I can sent these settings for an empty TextView.

Thanks,
Apaly

Hi @apaly! Thanks for download and use NAppGUI.
The text properties in TextView will be applied in next textview_writef(). I will fix the control so that they are taken into account in editing.

Hi @frang75,
Thanks a lot. Your commitment to the library is impressive.

Implemented on this commit: f6c2ee0

In order not to alter the current operation of the control, the textview_apply_all() function has been added, which sets the text parameters for the entire control. If the control is empty, they will be taken as default attributes.

Doc: https://nappgui.com/en/gui/textview.html#h4
Demo: https://nappgui.com/en/howto/guihello.html#h6

Related with this issue: #148

@frang75, all I can say is wow! to your very quick response to this issue and update of the documentation!

The solution is also well thought out.

Thanks a lot.