Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello, i am hoping you can help me. I am using the Win32::GUI module and i have a listview added. I am trying to catch a button-click on a column name so i can sort on that column. I am looking through the documentation but i can't find anything. Here is what i have so far:
use strict; use warnings; use Win32::GUI(); use DBI; my $mw = Win32::GUI::Window->new( -text => "View", -size => [ 550, 500 ], -pos => [ 200, 200 ], ); sub mw_Terminate { return -1 } my $lv = $mw->AddListView( -pos => [ 20, 20 ], -size => [ 400, 400 ], -gridlines => 1 ); $lv->InsertColumn( -item => 0, -text => "PID", -width => 50); $lv->InsertColumn( -item => 1, -text => "Name", -width => 100); $lv->InsertColumn( -item => 2, -text => "Address", -width => 100); $lv->InsertColumn( -item => 3, -text => "Salary", -width => 100); my $dbfile = 'C:/code/lqs.db'; my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","",""); my $stmt = qq(select id,name,address,salary from deliver order by sala +ry desc); my $sth = $dbh->prepare($stmt); $sth->execute; while(my @row = $sth->fetchrow_array()){ $lv->InsertItem(-text => [$row[0],$row[1],$row[2],$row[3]]); } $mw->Show; Win32::GUI::Dialog();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::Gui listview column click
by Anonymous Monk on Aug 19, 2018 at 11:52 UTC | |
by Anonymous Monk on Aug 20, 2018 at 08:26 UTC | |
by Anonymous Monk on Aug 20, 2018 at 08:33 UTC | |
by Anonymous Monk on Aug 20, 2018 at 09:22 UTC | |
by Anonymous Monk on Aug 20, 2018 at 11:04 UTC | |
| |
Re: Win32::Gui listview column click
by Anonymous Monk on Aug 18, 2018 at 14:18 UTC | |
by FreeBeerReekingMonk (Deacon) on Aug 19, 2018 at 10:19 UTC | |
Re: Win32::Gui listview column click
by Anonymous Monk on Aug 20, 2018 at 07:49 UTC |