Hello,

Le Sun, 18 Dec 2022 20:41:56 +0000,
Ranier Fonseca <ranier_...@hotmail.com> a écrit :

> >  IupFrame doesn't take the width of the title into account when it
> >calculates the width of the frame.
> >  Therefore, when the content of the Frame is not wide, the title is
> >cut short.  
> I didn't check if it's a bug or not.

   Well, I guess that when we set a title, we expect it to be displayed
fully and correctly, don't we? :-)


> But You can use IupVbox and IupHbox to change your layout and get the
> result you need.

  Yeah, thank you, but that's more like a work around, because you need
to hardcode the dimension of the content, or calculate it by yourself
(and the calculation will probably be at least as brittle as my Q&D
patch).

----

>>   My patch is just meant as an example (and a quick&dirty fix for
>> me), not for direct inclusion. It is probably very brittle: I didn't
>> account for the "_IUPFRAME_HAS_TITLE" I can see in other parts, I
>> assumed the result of iupdrvFontGetStringWidth() was reliable (is
>> it?), and I added an hardcoded value to get some extra space).

  BTW, I forgot to add to my list of assumptions: I also assumed that
the font and font size of the Label were the same as the default font,
which may be true or not, depending on which back-end is used.


Goodbye,
  Stéphane.


_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to