Albrecht Schlosser wrote:

> Fabien Costantini wrote:
>> If it is made clear that it could be intersting to get a default
>> configurable class name for all windows created after a setting, then we
>> could also add an Fl_Window static member...
> 
> That's what I thought of and why I proposed this. If the current default
> would be to derive the class name from argv[0], then it would be useful to
> set a global default, but otherwise you're right and it should be a window
> property - with a useful default value...
> 
> Albrecht

Since xclass is automatically set by Fl_Window::show(int,char**), why not
store the string as a static member in Fl_Window as well (e.g.
Fl_Window::default_xclass). Basically, when show(int,char**) is called it
checks xclass(). Regardless if show(int,char**) creates a WM_CLASS from
agv[0] or uses the string supplied by the user, e.g. o->xclass("foobar");,
the value is saved in the static memember Fl_Window::default_xclass. I
would guess that for 99.999% of the FLTK applications, default_xclass would
be set from argv[0] by show(int,char**).

Then, when Fl_Window::show() is called, if xclass is not set, the value from
default_xclass would be used. This would ensure that every Fl_Window
created by the application will have its WM_CLASS set.


-- 
Alvin
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to