[vtkusers] Re: VTK on Mac OS X

Chris Scharver scharver at evl.uic.edu
Mon Jan 19 10:44:05 EST 2004


On Jan 19, 2004, at 8:05 AM, James Dessart wrote:

> But can you interact with the windows that are created?  This is a  
> problem I have had since day one with the windows created from the  
> command line.  What is missing is information that the application  
> needs to provide in order to connect to the Window Server.  Running  
> from the command line, in this manner, stops that from happening.

This behavior is apparently intentional on Apple's part. Applications  
are supposed to be "bundled" with an application package  
<http://developer.apple.com/documentation/MacOSX/Conceptual/ 
SystemOverview/AppPackaging/chapter_5_section_1.html#//apple_ref/doc/ 
uid/20000983>. Of course, this is in contrast with how most unix  
applications work. MacOS X names these command-line executables  
"tools," and they're assumed to not use a GUI. There are four lines of  
undocumented code that can make a process register properly with the  
window server. The problem is that this application won't have a proper  
menu bar and doesn't fit as a 'true' MacOS X application. The question  
then becomes whether this is an issue with the VTK library or your  
application's source code.

Apple did code a special workaround in GLUT to make command-line  
applications register properly. It's intentionally obscure to recreate,  
but it can be done. I'm using Cocoa, so I think I just made some  
changes to vtkCocoaRenderWindow. I wouldn't recommend it as anything  
other than a quick hack. :)

Chris

--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
Ph: 312-996-3002   FAX: 312-413-7585
<http://www.evl.uic.edu/scharver/>




More information about the vtkusers mailing list