On Sat, May 01, 2004 at 09:09:00 +0200, Bruno Boettcher wrote:
Hi after switching forth and back from TreeView to SimpleList i finally got something working.... but, i don't understand where my error was with simpleList.... i made $widget->{data} = $array_ref; which yielded no result whatsoever, but doing @{$widget->{data}} = @$array_ref; does the job.... besides the fact that the latter one copies the structure (which isn't needed..) where's the difference, and why did the previous one not work??? should be the same no??
Sure NO! The $widget->{data} is a tied arrayref. That is, it works as arrayref, but is actualy a ListStore (see perldoc perltie). If you assign $widget->{data} = $array_ref, you replace it with your array ref -- which is not tied to the ListStore, so it does not work. While if you @{$widget->{data}} = @$array_ref, you replace it's contents with content of your array ref, which, through the tie magic, gets stored in the ListStore and thus displayed in the TreeView. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb ucw cz>
Attachment:
signature.asc
Description: Digital signature