From: Matthias M. <mm...@ma...> - 2025-07-01 19:12:10
|
> On 1. Jul 2025, at 20:24, Robert Arkiletian <ro...@gm...> wrote: > > The part I'm a little confused about is that the FLTK documentation > states that measure_label is a set method but to me it really seems > like a get method by reference. Fl_Label::measure(int &width, int &height) When you call it, `width` is the preferred width in pixels where FLTK will word-wrap the label text. Depending on the width, the height will change if the text actually wraps at some horizontal position once or multiple times. If width is 0, FLTK does not use word wrapping. When returning, width is the actual width of the output. If width was 0 on input, it will be the width of the entire string. Height will be the font height, multiplied with the number of newlines and wordwraps. Maybe this works? %apply int *INOUT { int &W }; %apply int *OUTPUT { int &H }; void Fl_Label::measure(int& W, int& H) const; or void Fl_Label::measure(int& INOUT, int& OUTPUT) const; or write a wrapper that is easy to translate: void Fl_Label_measure(Fl_Label *self, int w, int *INOUT, int *OUTPUT) const; Apologies for the guess work. I know FLTK, but very little SWIG. |