Jane wrote:
> well, ok then, this problem is no more, i do the
> calculation in the constructor, that fixes it. :)
okay :-)
> ok, here is more detail:
>
> int main(int argc, char *argv[])
> {
> pmesg(40, "main()\n");
> ui = new Prodatum_UI();
> ui->startup(argc, argv);
> Fl::lock();
To see what really happens, you might add one more line:
pmesg(40, "Fl::run()\n");
> return Fl::run();
> }
Then I would expect that all your initialization ...
> rolling:
>
> main()
> ---- ui ---- prodatum_ui::Prodatum_UI()
> ---- ui ---- Prodatum_UI::startup()
>>>> ctrl <<< Prodatum_CTRL::Prodatum_CTRL()
[...]
> ...oh, here comes data for the piano:
>
> ### data ### Prodatum_Data::Parameter_Value_Request(1416, 0)
> ### data ### Prodatum_Data::IDMap(1416, 0)
> $$$ Piano $$$ Piano::Set_Range_Values(0, 0, 84, 0, 127, 0)
> ### data ### Prodatum_Data::Parameter_Value_Request(1413, 1)
>
> ... more data for the piano
... happens before ...
Fl::run()
but the first drawing will be done after you call Fl::run():
> shortly after we have all the data and finally the piano is
> shown:
>
> $$$ Piano $$$ Piano::draw()
> $$$ Piano $$$ Piano::draw_piano()
> $$$ Piano $$$ Piano::draw_ranges()
>
> at this point the UI is ready to be used.
... and that's how FLTK works generally. You call some methods for your
widgets like show(), data(), ..., then maybe redraw() at initialization
and/or in a callback, and then you give or return control to FLTK's main
loop Fl::run(), and that does eventually call your draw() method, when
there is time to do it (no messages pending).
Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk