Hi all
Enjoy reading all the help emails generated by this group so thought I'd
ask for some help please with listview.

I've used TheLoft to create a gui interface for a program I'm writing. A
button I click is meant to read a selected line from a listview pane and
display the results in a selection of tf / cb controls:

    # determine which rows have been selected
    my @selection = $win-> lvwFleece-> SelectedItems();
    
    my $size    = @selection;   # determine how many rows have been
selected
    my %temp;                        # hash for reading listview data
    my $field;                           # field name to match column
heading

    if ((@selection) and ($size == 1)) {
        # display the one row selected
        foreach my $c (0..$max_fleece-1) {
            %temp = $win-> lvwFleece-> GetItem($selection[0],$c);
            $field = $fleece_fields[$c];
            $win-> $field-> Text("$temp{-text}");
        }
    }

The code works and produces the required output but I have some queries
that puzzle me.

1. @selection contains the index values of the rows selected. However,
if no rows are selected I was expecting it to be return a () array but
printing its size in such a case shows a value of 1. Why would that be?

2. I really need some better way to determine if the listview has been
clicked. The event ItemClick(ITEM) in the package description for
listview looks as though it could be a better option for me. Can someone
kindly help me to construct the line to determine if the listview has
had a line selected please? I'm still learning perl and I'm puzzled how
to do this simple task.

Thanks
Brian Rowlands
We must accept finite disappointment, but we must never lose infinite
hope.
Martin Luther King Jr. </quotes/k/martinlutherking/>  



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to