[vtkusers] cursor management

Karthik Krishnan karthik.krishnan at kitware.com
Tue May 11 03:22:53 EDT 2010

This is great.. I'm sure custom cursors would be very useful. If your cursor
isn't supported in the default list of cursors (for instance for unix
(xfree86/xorg), here is a typical list that can be added to the
corresponding render windows (vtkXOpenGLRenderWindow etc).


The niche ones like a Rotate cursor etc aren't available. I took a cursory
(laughing) look at how OpenInventor does this.. As you know they have a
rotate cursor for the roll action (search for so_xt_roll_bits to get the
bitmap). The bitmaps for the cursors (see SoXtCursor) and allow custom

See the OpenInventor chapter "Using cursors for feedback" on how to set
these custom bitmaps..


// This routine is used to define cursors..
void simpleViewer::defineCursors()
   XColor foreground;
   Pixmap source;


   // View plane translate cursor
   source = XCreateBitmapFromData(display, d,
            so_xt_flat_hand_bits, so_xt_flat_hand_width,
   vwrCursor = XCreatePixmapCursor(display, source, source,
               &foreground, &foreground, so_xt_flat_hand_x_hot,
   XFreePixmap(display, source);

   // Seek cursor
   source = XCreateBitmapFromData(display, d,
            so_xt_target_bits, so_xt_target_width,
   seekCursor = XCreatePixmapCursor(display, source, source,
                &foreground, &foreground, so_xt_target_x_hot,
   XFreePixmap(display, source);

   createdCursors = TRUE;

It would be great to add this kind of functionality to expand VTK's cursor

On Mon, May 3, 2010 at 12:08 PM, Dean Inglis <dean.inglis at camris.ca> wrote:

> I have an application in which Id like to have
> a cursor to indicate rotation is occuring during widget interaction,
> however,
> VTK is limited to a basic set of cursors which does
> not include such a cursor.  Im guessing
> this is to maintain cross-platform compatibility.
> Anyone have any experience coding a custom
> cursor they could share (Windows or any other
> platform)?
> thanks,
> Dean
> _______________________________________________
> Powered by www.kitware.com
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100511/81598c82/attachment.htm>

More information about the vtkusers mailing list