Besides a built-in cursor name, the -cursor option also accepts a cursor specification, which is an array reference of four elements: an X11 bitmap (XBM) filename, a mask filename, and foreground and background colors.
on unix/linux it would look like
The X11/cursorfont.h file contains the names, tracking it down from there is left to you.my $cursor = [qw/@mouse.xbm mouse.mask brown white/];
Here is code from the MPTk's sample code:
It is supposed to give you a transparent cursor, but it shows the idea. If you want the images, track them down on the Mptk website, under Chapter code samples.#!/usr/bin/perl -w use Tk; use strict; my $mw = MainWindow->new; my $c = $mw->Canvas->grid; $c->configure(-cursor => ['@images/trans_cur.xbm', 'images/trans_cur.msk', 'black', 'white']); $c->CanvasBind('<Motion>' => sub { my($c) = @_; my($x, $y) = ($Tk::event->x, $Tk::event->y); print "cursor at canvas coordinate ($x,$y)\n"; }); MainLoop;
In reply to Re: Modifying Standard Tk Cursors?
by zentara
in thread Modifying Standard Tk Cursors?
by Dr. Mu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |