[vtkusers] vtkFlRenderWindowInteractor in Mac OS X

Sean McInerney seanm at nmr.mgh.harvard.edu
Mon Jan 31 15:21:19 EST 2005


Hi Marius,

   When a FLTK window is closed, its callback is called. If this 
callback function calls exit(), the application terminates at that point 
without any subsequent application code being called (unless registered 
with atexit()). Check to see if this is the case in Charl's code.

-Sean

Marius S Giurgi wrote:
> Anybody tried to use vtkFlRenderWindowInteractor in Mac OS X?
> 
> Yes, I did study the example over and over and over, but... there are 
> still a few issues. Perhaps I'm still missing something. (maybe someone 
> could help me out? please?)
> 
> First of all, in Charl's Cone3 example it says:
> 
>   // this is the standard way of "starting" a fltk application
>   int fl_ret = Fl::run();
> 
> This should be about right, BUT just to test it,  I "bracketed" the 
> loop-starting command with:
> 
>   cout << "Starting the loop" << endl;
> 
>   // this is the standard way of "starting" a fltk application
>   int fl_ret = Fl::run();
>   // very huge NB: note that we ->Delete() the vtkFlRenderWindowInteractor
>   // once we do this, the rest of the vtk pipeline will really disappear
> 
>   cout << "Ending the loop" << endl;
> 
> As one should expect, after hitting the quit button, or close the 
> application, the loop gets interrupted and the rest of the code (after 
> the Fl::run) gets executed, which is, delete the fl_vtk_window, etc. The 
> "Ending the loop" messages should display as well.
> 
> However, what I found out is that the code after the Fl::run never gets 
> executed (there's no "Ending the loop" message when I quit the 
> application). Am I lacking some fundamental concepts here? Is this 
> supposed to happen? Again this runs in Mac OS X.
> 
> 
> Second:
> in the Cone3 example the quit button and the text does NOT appear, as 
> the vtk window overlaps with it. I included a few captures below.
> 
> Note: on Apple (Mac OS X) the default FLTK resource fork (/FL/mac.r) has 
> to be attached to the executable
> in order to interact with the window at all. (the following captures 
> were taken without this fork attached to the Cone3 executable, however 
> attaching the fork doesn't change the display).
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> Capture1: Plain build of the Cone3 example. Actually you can see the 
> text being displayed for
> a fraction of a second then the vtk windows get displayed on top of them.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> Capture2: Here I commented out the  fl_vtk_window2->show(); and rebuilt 
> the Cone3
> You can see that the text and button now shows (on the second window), 
> but (obviously) not
> the vtk window. Once I  click on the Second window, the vtk window pops 
> up as a separate window.
> The Second window can be used for interaction (rotate, move, zoom the 
> SuperQuadric that is
> displayed in the pop up window). (The vtk window does not allow for 
> interaction).
> 
> 
> ------------------------------------------------------------------------
> 
> 
> Capture3: the Quit button is visible and it can be clicked :) However 
> regardless of how I chose
> to quit the application the rest of the code (after Fl::run) doesn't get 
> executed. Why?
> 
> marius
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list