|
|
On 8/11/21 5:55 AM, Daniel Santos
wrote:
Hi, I'm trying to put vertical text in a button, I'm using the \n
newline, but the vertical spacing is too big, is it possible to
put less spacing?
Thanks
I take this to mean you have maybe:
___________________
| |
| Line One |
| |
| Line Two |
|___________________|
I don't think FLTK allows you to control the line spacing
(hmm, not sure why that is),
but you can derive a class from Fl_Button, and then handle the
text drawing bit yourself,
drawing each line where you want it with separarte fl_draw()
calls to handle the text.
Or, if it's a fixed message, you could just render the text as
an image in a paint program
and save it as an .xpm, then just #include the xpm and use it
as the image() for the button..
similar to how an xpm image is assigned to an Fl_Box in this
demo:
http://seriss.com/people/erco/fltk/#DraggableBoxes
To assign an image you don't need to derive a class from
Fl_Button, just assign the image()
to it with e.g.
#include "my_text.xpm"
[..]
static Fl_Pixmap my_text_pixmap(my_text);
Fl_Button *but = new Fl_Button(..);
but->image(my_text_pixmap);
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/81be6be2-404b-e3c4-fcbd-08f22198c9ed%40seriss.com.
[ Direct Link to Message ] | |
|
| |