Here's a program to look at the different cursors
interactively. It's really simple, just a Listbox full of
cursor shape names and a button binding that changes the
application's cursor. The hardest part is figuring out where
the list of cursor names is hidden.
$mw = MainWindow->new;
$mw->Button(-text => "Exit",
-command => sub { exit })->pack(-side => "bottom",
-fill => "x");
$scroll = $mw->Scrollbar;
$lb = $mw->Listbox(-selectmode => 'single',
-yscrollcommand => [set => $scroll]);
$scroll->configure(-command => [yview => $lb]);
$scroll->pack(-side => 'right', -fill => 'y');
$lb->pack(-side => 'left', -fill => 'both');
## Open file that contains all available cursors
## Might have to change this if your cursorfont.h is elsewhere
## On Win32 systems look in C:\Perl\lib\site\Tk\X11\cursorfont.h
open (FH, "/usr/X11R6/include/X11/cursorfont.h") ||
die "Couldn't open cursor file.\n";
while (<FH>) {
push(@cursors, $1) if (/\#define XC_(\w+) /);
}
close(FH);
$lb->insert('end', sort @cursors);
$lb->bind('<Button-1>',
sub { $mw->configure(-cursor => $lb->get($lb->curselection)); });
MainLoop;