calendar marked_date array



both [1] and [2] seem to say that each calendar object (widget) should
have an array called marked_date that stores which days are marked.
should this not do it?

my $calendar = new Gtk2::Calendar();
$calendar->display_options( 'show-heading' );
$calendar->signal_connect( 'day_selected' => \&calDaySelected );
$calendar->show();

[...]

sub calDaySelected {
  my( $cal ) = @_;
  $cal->freeze();
  my ( $y, $m, $d ) = $cal->get_date();
  if ( $cal->marked_date[ $d-1 ] ) {
    $cal->unmark_day( $d );
  } else {
    $cal->mark_day( $d );
  }
  print "day $d selected!\n";
  $cal->thaw();
  return;
}

but when i try to execute this code, i get:

syntax error at ./foo.pl line 181, near "->marked_date["
syntax error at ./foo.pl line 183, near "} else"

what am i doing wrong here?  i'm using strict and all ... hm.

thanks,

</nori>

[1] http://personal.riverusers.com/~swilhelm/gtkperl-tutorial/calendar.html
[2] http://developer.gnome.org/doc/API/2.0/gtk/GtkCalendar.html

-- 
    .~.      nori @ sccs.swarthmore.edu
    /V\  http://www.sccs.swarthmore.edu/~nori/jnl/
   // \\          @ maenad.net
  /(   )\       www.maenad.net
   ^`~'^
            get my (*new*) key here:
   http://www.maenad.net/geek/gpg/7ede5499.asc
      (please *remove* old key 11e031f1!)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]