Re: SimpleList redraw/refresh



* Ross McFarland <rwmcfa1 neces com> [2004-07-11 21:12]:
the only thing to watch out for is replacing the reference,
i.e. don't do this:
      $categories->{data} = \ data;
because you'll lose the tie magic that is SimpleList.

This is discussed *so* often on the list. Is there no reasonable
place which could check the 'data' value reference for having
the right magic and throwing an error if it doesn't? If that
message includes a pointer to the docs, then this question would
probably cease.

One thing that irks me about the interface, and which is also the
source of these questions, is that it doesn't quite follow common
tie() practice. I feel it would be better if the interface was
something along the lines of

    tie my @sl, 'Gtk2::Ex::Simple::List';

And then could either store the return value of tie() to talk to
the widget, or used tied(@sl) to retrieve it later, like

    tied(@sl)->get_selection->set_mode('multiple');

And since you then have @sl, not @{$sl->{data}}, there's no issue
about "replacing the ref" either.

Regards,
-- 
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."



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