Greg Ercolano wrote:
> Fl_Browser has a built in struct, FL_BLINE, which manages
> the individual browser items.
> 
> Unfortunately this struct is 'secret', defined in the .cxx file,
> and thus having no hope of being accessible to derived widgets.

I think that this is intentional.

> This is fine as long as no one tries to work with browser items
> directly, but it seems Fl_File_Chooser /did/ need to do this,
> and has its own definition of the FL_BLINE struct.

I consider this a hack. The original design was to subclass Fl_Browser_ (note 
the trailing underscore) and to have one's own (private) item structure, if I 
read the docs correctly [1] (see the "Description"). In an ideal world 
Fl_Browser would provide accessor functions for its opaque FL_BLINE struct, if 
this would be necessary at all.

[1] http://www.fltk.org/doc-1.1/Fl_Browser_.html

> Which means changes to the FL_BLINE struct will affect
> other code that have to define their own private FL_BLINE
> struct. (Such an ABI breaking change was made for STR#1739)

Yes, that's really bad, but that's how it is now :-(

> So my feeling is, if FL_BLINE is really needed, maybe
> we should at least make the FL_BLINE struct public, either
> leaving it undocumented, or documenting it and possibly even
> renaming it so that its public 'debut' has a naming convention
> consistent with the FLTK interface. Hell, maybe it should even
> be a 'class'..!

One way to avoid making it public (and I would vote for not making it public!) 
would be to use a common include file, so that we don't need to worry about 
later changes.

However, as Matthias said, maybe the used "approach is wrong per se", and we 
shouldn't care about it further, because we will have a better (group based) 
one 
later.

But I'd agree that something _could_ be done now, and I suggest using a common 
header file (maybe in the src directory ?). This header should contain a 
prominent note that it is only intended for use in Fl_Browser.cxx and 
Fl_File_Browser.cxx.

Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to