On 04.02.2009, at 15:12, Fabio Bracci wrote:

>> You need to have a window mapped before you can create your  
>> offscreen.
>> So you need to show your aWin object, and wait until it has actually
>> been established, before you can safely create the offscreen context.
>
> This is one of the points I don't get: I first create a window and  
> then I show it, isn't this just enough to have a window mapped?

To make sure that the window is actually mapped, this should work:

while (!win-shown()) Fl::wait(0.01);

> And a more fundamental remark is: why isnn't such a offscreen  
> totally independent of the widgets, visualized or not?

Yes, it should work independently. I am afraid that this was never  
fully tested and fl_create_offscreen misses some minimal  
initialisation, maybe the connection to the X11 server (which is  
required for offscreen rendering). This would be worth looking into on  
every supported platform.

>> You are probably best deriving a viewer widget of your own, say  
>> derived
>> from Fl_Box or similar, and from within its draw method, the first  
>> time
>> it is called, you can then safely create your offscreen. You can be
>> sure, if the draw() method is called, that the object is mapped to  
>> the
>> display.
>
> Aha, I see. well, this looks to me as a workaround. Is this the only  
> way to go? I already developed a quite complex system, It doesn't  
> feel right to manipulate again the callbacks of my already complex  
> widget structure ...

This is mixed up a little. The offscreen code is not related or  
derived from any particular widget type. But, see above.

>> I'm fairly sure I posted examples of this in the past - but I take it
>> they were not found?
>> If I can find the examples at home, I'll try and post them later on.
>
> I'm analyzing your example now, indeed there was just that example  
> from Lukasz in the general forum.


This conversation remids me of the Fl_Canvas prototype for incremental  
drawing that I had lying around. Maybe I can patch something usable  
together using the example and my stuff and drop it into 1.3.

Matthias

----
http://robowerk.com/


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

Reply via email to