|
From: Andreas K. <an...@ke...> - 2025-07-02 05:59:03
|
Hi Robert,
perhaps more like
fl_measure() in fl_draw.i. But there it is more complex,
some %ignore, some undo the ignore, another prototype.
I am also not very familiar with Swig.
Regards,
Andreas
Am Tue, 1 Jul 2025 11:24:22 -0700
schrieb Robert Arkiletian <ro...@gm...>:
> 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
>
|