Torsten Giebl schrieb:
> For me the biggest problem was how to share data
> between two or more windows.
I'm using FLUID for the windows and that makes things very easy, because
I can spend the data directly to the constructor. Passing things by
user_data or even a message class appears strange to me, this is not
really object-oriented, isn't it? I'm alway going like this and know in
detail about structure of my program:
class my_data;
class fluid_window
{
public:
fluid_window(my_data* pData): mp_Data(pData) {}
};
class my_app
{
private:
my_data m_Data;
fluid_window m_Dlg;
fluid_window_2 m_Dlg_2;
fluid_window_3 m_Dlg_3;
// be aware of order - construct data before dialog
virtual void Cb_Bn(Fl_Window* o, const char* v);
}
my_app::my_app():
m_Dlg(&m_Data), // Window dealing with data
m_Dlg_2(&m_Data, &m_Dlg), // Window dealing with data and Dlg
m_Dlg_3(this) // Window dealing with app functions
{}
A little trick I didn't mention before - I don't like fluid for editing
code, only using it for definition of windows. So I'm always making a
new class from fluid-window and Cb_Bn() is the callback by all window
objects - in FLUID there is an empty virtual void Cb_Bn(Fl_Window*o,
const char* v) {} and I'm using it for all callbacks like Cb_Bn(o,
"Button_One_Pressed");
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk