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? supsm17 Jun 22, 2021  
  I think the issue might've been that the vertical scroll bar was covering the text. I've added a little bit of extra space, it seems to be working now.

On Tuesday, June 22, 2021 at 4:32:00 AM UTC-7 Albrecht Schlosser wrote:
On 6/21/21 11:43 PM supsm17 wrote:
Thanks. I've noticed that widget->measure_label() and fl_measure() have the same value, which isn't correct. fl_text_extents() has a different value which is closer, but still isn't the correct value. Do you know why this is?

As Greg already wrote, fl_text_extents() should be absolutely exact but it's a little more difficult to use. You can see both fl_measure() and fl_text_extents() "in action" in our test/unittests.cxx demo program in the "rendering text" and "symbol text" examples (the latter only with fl_measure()).

A potential problem with using these functions is that you need to set the font before you call the measure functions. Otherwise a random font will be used for measurement. This might explain your differences.

If you can't find a solution, I suggest that you post your code in form of a minimal, but compileable source code here. Then we can see why it doesn't work for you and help.

--
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/e40436c3-a2a6-44e1-b6c1-a74749628500n%40googlegroups.com.
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'.