John,

i must say i've nearly forgotten that question. Well, i just checked what i asked and found out that the problem shifted a bit. At the moment the most urgent issue would be the following.

I have a list and want to know which cell was clicked. I set a hook to a sub handeling clicks on my list and thought the 'get' method of Mac::Lists would be what i need. But it seems that i misunderstood something.

Because i get only this error:

# Assertion failed: file "sv.c", line 2961.
File 'OS9:Desktop Folder:MartinsList.pl'; Line 71

I will put the script below so that you can see what i'm talking about.
Maybe someone can tell me what's wrong and what i have to do. Besides of that i would like to know if someone else used the ListManager in his scripts and could provide some examples for me.


Thanks in advance and best regards
  Martin

P.S.: I "solved" the other problem. Now TeX writes all arguments to an external file which postprocessed by my script.

<--- Martin's List --->

#!perl
### loading modules

## general
use warnings;
use strict;

## Mac
use Mac::Windows;
use Mac::QuickDraw;
use Mac::Events;
use Mac::Fonts;
use Mac::Lists;

#########################################################
### variables and constants

my ($style, $title, $win, $winr);

my @numbers = (1,2,3,4,5);
my ($list1);

my @point;

#########################################################
### main

$style = floatProc();
$title = 'Titel';
$winr  = Rect->new(75, 75, 240, 210);
$win   = MacWindow->new(
  $winr, $title, 1, $style, 1
);

SetPort($win->window);
TextFont(geneva());
TextSize(9);

$list1 = $win->new_list(
  Rect->new(0, 0, 165, 70),
  Rect->new(0, 0, 1, scalar @numbers),
  Point->new(0, 13), 0, 1, 0, 0, 0
);

$list1->sethook('click' => \&handle_click);
for (my $c = 0; $c <= $#numbers; $c++) {
$list1->set(0, $c, $numbers[$c]);
}


while ($win->window()) {
    WaitNextEvent();
}

END {
    $win->dispose() if (defined($win));
}

sub handle_click {
my ($list,$win,$point) = @_;
print $_."\n" for (@_);


print "click\n";

print $list->get(0,0)."\n"; # This works
print $list->get($point)."\n"; # This does not work


}

# Thats all, folks!!!
__END__

<--- end --->

--
"Bigamy is having one wife/husband too many.
Monogamy is the same."
                                Oscar Wilde

Reply via email to