FLTK logo

Re: [fltk.general] Automatically resize buttons?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Automatically resize buttons? Albrecht Schlosser Jun 21, 2021  
 
On 6/21/21 6:44 PM supsm17 wrote:
I have several buttons in a scroll. I want the buttons to only be the size of the label, instead of a fixed size which could be too short or too long for the label. Currently, I set a large value as the width so the text doesn't get cut off. However, this makes the scroll bar inaccurate, and there is a lot of whitespace at the end. Is there any way to accomplish this?

You can always measure the text (label) size with fl_measure() or fl_text_extents(), then set the sizes accordingly.

https://www.fltk.org/doc-1.4/group__fl__drawings.html#gaccd92d0c0521b0aac30dcb856d438dcd https://www.fltk.org/doc-1.4/group__fl__attributes.html#ga14cb75a92b6cdd576f9512b38a208f8b

If this doesn't answer your question I may have misunderstood what you're looking for.

--
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/712de419-c4ca-2d03-edb4-895d42283b24%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.