From: Robert A. <ro...@gm...> - 2025-07-01 18:24:46
|
Hi Mr. Kemnade, We have not yet implemented the widget.measure_label method typemap in the swig interface files. Andreas H. usually does this work. I tried it myself by adding %apply int* OUTPUT { int& ww, int& hh }; to swig/Fl_Widget.i and rebuilding, but it failed as I'm not very familiar with Swig. We will put this on our radar for the next release if possible. If you can figure out how to patch the swig interface files to make it work, please let us know. 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. Here is a snippet example of how it's used in C++ from src/Fl_File_Chooser.cxx void Fl_File_Chooser::ok_label(const char *l) { if (l) okButton->label(l); int w=0, h=0; okButton->measure_label(w, h); okButton->resize(cancelButton->x() - 50 - w, cancelButton->y(), w + 40, 25); okButton->parent()->init_sizes(); } On Mon, Jun 30, 2025 at 2:45 AM Andreas Kemnade <an...@ke...> wrote: > > Hi, > > I wonder a bit how the measure_label method should be used. > Intuitively according to https://www.swig.org/Doc1.3/Arguments.html in > the genwinsize example I would expect > w,h = widget.measure_label() > > but that does not work. So what is the right way? > > Regards, > Andreas > > > _______________________________________________ > Pyfltk-user mailing list > Pyf...@li... > https://lists.sourceforge.net/lists/listinfo/pyfltk-user |