FLTK logo

Re: [fltk.general] Fl_Scroll broken?

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: Fl_Scroll broken? supsm17 Jun 20, 2021  
  That solved the issue, thank you so much!
On Saturday, June 19, 2021 at 11:18:58 PM UTC-7 er...@seriss.com wrote:

Fl_Check_Button* o = new Fl_Check_Button(470, 60 + 15 * numbuttons, 1000, 15, name.c_str());


    Here Fl_Check_Button's constructor is saving the pointer to name.c_str()
    and is not making a copy of the string. So the string has gone out of scope by the
    time the strings are being drawn.

    Instead use:

Fl_Check_Button* o = new Fl_Check_Button(470, 60 + 15 * numbuttons, 1000, 15);
        o->copy_label(
name.c_str());

    ..so that the widget internally makes a copy of the string.

--
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/481e2285-039d-4431-a9a0-5ced73da8510n%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'.