You can subscribe to this list here.
2001 |
Jan
(226) |
Feb
(139) |
Mar
(156) |
Apr
(95) |
May
(181) |
Jun
(166) |
Jul
(80) |
Aug
(59) |
Sep
(69) |
Oct
(83) |
Nov
(142) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(91) |
Mar
(76) |
Apr
(113) |
May
(67) |
Jun
(68) |
Jul
(37) |
Aug
(41) |
Sep
(16) |
Oct
(135) |
Nov
(51) |
Dec
(21) |
2003 |
Jan
(37) |
Feb
(36) |
Mar
(37) |
Apr
(103) |
May
(68) |
Jun
(70) |
Jul
(77) |
Aug
(12) |
Sep
(9) |
Oct
(53) |
Nov
(88) |
Dec
(63) |
2004 |
Jan
(263) |
Feb
(106) |
Mar
(36) |
Apr
(21) |
May
(21) |
Jun
(34) |
Jul
(33) |
Aug
(34) |
Sep
(35) |
Oct
(21) |
Nov
(43) |
Dec
(63) |
2005 |
Jan
(28) |
Feb
(42) |
Mar
(29) |
Apr
(14) |
May
(41) |
Jun
(20) |
Jul
(65) |
Aug
(136) |
Sep
(41) |
Oct
(74) |
Nov
(34) |
Dec
(94) |
2006 |
Jan
(85) |
Feb
(94) |
Mar
(68) |
Apr
(103) |
May
(66) |
Jun
(51) |
Jul
(24) |
Aug
(56) |
Sep
(57) |
Oct
(85) |
Nov
(73) |
Dec
(68) |
2007 |
Jan
(59) |
Feb
(32) |
Mar
(13) |
Apr
(32) |
May
(36) |
Jun
(36) |
Jul
(64) |
Aug
(35) |
Sep
(19) |
Oct
(10) |
Nov
(13) |
Dec
(20) |
2008 |
Jan
(26) |
Feb
(41) |
Mar
(19) |
Apr
(24) |
May
(16) |
Jun
(33) |
Jul
(34) |
Aug
(4) |
Sep
(11) |
Oct
|
Nov
(26) |
Dec
(23) |
2009 |
Jan
(5) |
Feb
(2) |
Mar
(21) |
Apr
(16) |
May
(13) |
Jun
(6) |
Jul
(34) |
Aug
(2) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(24) |
2010 |
Jan
(3) |
Feb
(5) |
Mar
(6) |
Apr
(6) |
May
(14) |
Jun
(6) |
Jul
(1) |
Aug
(12) |
Sep
(10) |
Oct
(9) |
Nov
|
Dec
(2) |
2011 |
Jan
(4) |
Feb
(5) |
Mar
(30) |
Apr
(1) |
May
(2) |
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(6) |
Dec
|
2012 |
Jan
|
Feb
(10) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(4) |
2013 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(3) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(7) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jonathan S. <jso...@al...> - 2001-02-19 13:34:34
|
Eric, I use a listview in one of my applications I have wriutten and do not have that problem. What does your listview contruct look like? Is there any other code that might be responsible for this maybe? Jonathan Southwick Technical & Network Services Allegheny College, Meadsville, PA jso...@al... ----- Original Message ----- From: "Erick J. Bourgeois" <er...@e-...> To: <per...@li...> Sent: Friday, February 16, 2001 1:36 PM Subject: [perl-win32-gui-users] ListView Column Resize > Has anyone had the listview disappear if you try and resize > the column? If I resize it, the first time it disappears, > the second it reappears but without the scrollbars. Any one > else? > > erick > never stop questioning > www.jeb.ca > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |
From: Ludvig af K. <kli...@ho...> - 2001-02-18 17:48:33
|
This may not be a straight Win32::GUI question, but I think it might concern those who write networking Perl scripts with a UI for win32. The question is simple: how to make a socket nonblocking in Perl on Windows? The usual fcntl($sock,F_SETFL,O_NONBLOCK) does apparently not work, so what to do? I have a vague memory of some hackish parameters that could do the trick, but I don't remember what... -Ludde |
From: Thomas, T. B <tim...@lm...> - 2001-02-16 20:20:22
|
It seem that is what most people are doing, I personally like pulling = the data directly from the object. Tim =20 ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... <mailto:tim...@lm...>=20 ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Michael Solomon [mailto:MSo...@3s...] Sent: Friday, February 16, 2001 6:59 AM To: 'per...@li...' Subject: RE: [perl-win32-gui-users] get value from list Tim,=20 Thanks for your help with this=20 I realised that as I was supplying the data to the list box I just = needed to put it into an array and use:=20 sub ListView_ItemClick {=20 $item =3D shift;=20 print $asset[$item];=20 =20 }=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are not=20 the named recipient please notify us immediately. You must not copy or disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 -----Original Message-----=20 From: Thomas, Timothy B [ mailto:tim...@lm... <mailto:tim...@lm...> ]=20 Sent: 15 February 2001 17:45=20 To: 'per...@li...'=20 Subject: RE: [perl-win32-gui-users] get value from list=20 There is a SelectedItems function you can use.=20 Here's a bit of code that will get the data from all the selected = items.=20 Once you determine which item you have selected you can use that other = piece of code to get the data from every column, or you can use this example = if=20 you just want the first column.=20 see the documentation at http://dada.perl.it/gui_docs/gui.html <http://dada.perl.it/gui_docs/gui.html> for more=20 help.=20 if ($ListView->SelectCount() gt 0)=20 {=20 for $i(0..$ListView->SelectCount()-1)=20 {=20 =20 %data=3D$ListView->ItemInfo(($ListView->SelectedItems)[$i]);=20 $filename=3D$data{-text};=20 ...=20 ------------------------------------------------------------------------= ---- ---------------------=20 Tim Thomas=20 Unix Systems Administrator=20 Lockheed Martin EIS =B7 Denver Data Center=20 303-430-2281=20 mailto:tim...@lm... <mailto:tim...@lm...> =20 ------------------------------------------------------------------------= ---- ---------------------=20 -----Original Message-----=20 From: Michael Solomon [ mailto:MSo...@3s... <mailto:MSo...@3s...> ]=20 Sent: Thursday, February 15, 2001 10:32 AM=20 To: 'per...@li...'=20 Subject: RE: [perl-win32-gui-users] get value from list=20 Tim,=20 Thanks for this=20 Unfortunately this gets all the items from the list=20 What I want to do is to click on an item in the list and just capture = that=20 For example=20 If I have a list showing=20 1=20 2=20 3=20 if I click on the 3, I want to capture 3=20 I hope this makes sense=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are=20 not=20 the named recipient please notify us immediately. You must not copy or = disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 -----Original Message-----=20 From: Thomas, Timothy B [ mailto:tim...@lm... <mailto:tim...@lm...> ]=20 Sent: 15 February 2001 16:48=20 To: 'per...@li...'=20 Subject: RE: [perl-win32-gui-users] get value from list=20 Someone else has written a win32::Gui program to do just what you are = trying to do. I don't seem to have the code anymore. Maybe they can post it = again,=20 or you can search the archives.=20 Here's a piece of code I just wrote that gets all the data, including = the=20 image, from a listview, it puts it into a hash.=20 I used this with the column sort routine that has been floating around, = by=20 Jonathan Southwick [jso...@al...]. I am still working out the = bugs, but this section of code should help you.=20 # you must already have $totalcols (the # of columns in your=20 listview)=20 # I don't think there is a way to pull this from the = object.=20 %data=3D();=20 $rows=3D$ListView->Count();=20 for $i(0..$rows-1)=20 {=20 $row=3D"";=20 my %result=3D$ListView->GetItem($i,0);=20 $image=3D$result{-image};=20 for $j(0..$totalcols-1)=20 {=20 my %result=3D$ListView->GetItem($i,$j);=20 $text=3D$result{-text};=20 $row.=3D",$text";=20 }=20 $data{$i}=3D"$image$row";=20 #Win32::MsgBox("data($i)=3D$image$row\n");=20 }=20 ------------------------------------------------------------------------= ---- ---------------------=20 Tim Thomas=20 Unix Systems Administrator=20 Lockheed Martin EIS =B7 Denver Data Center=20 303-430-2281=20 mailto:tim...@lm... <mailto:tim...@lm...> =20 ------------------------------------------------------------------------= ---- ---------------------=20 -----Original Message-----=20 From: Michael Solomon [ mailto:MSo...@3s... <mailto:MSo...@3s...> ]=20 Sent: Thursday, February 15, 2001 5:19 AM=20 To: Perl Gui (E-mail)=20 Subject: [perl-win32-gui-users] get value from list=20 I am querying a database and putting the output into a listview=20 What I would like to next is to click on an item in the list and then=20 drilldown into the data base=20 The question is how can I return the value from a List=20 I am fairly new at using Win32::GUI and apologise if this is a stupid=20 question.=20 Should I be using a different type than listview and if so what should = I be=20 using?=20 use strict;=20 use Socket;=20 use Win32::GUI;=20 use Win32::ODBC;=20 #set variables=20 my (%Data, %new, $result, $Window, $width);=20 my $Dir =3D "//neptune/tech_dept/databases";=20 my $DBase =3D "asset.mdb";=20 my $DriverType =3D "Microsoft Access Driver (*.mdb)";=20 my $Desc =3D "Description=3DThe Win32::ODBC Test DSN for = Perl";=20 my $DSN =3D "tmpdsn";=20 $Window =3D new GUI::Window(=20 -name =3D> "Window",=20 -text =3D> "Win32::GUI::ListView test",=20 -width =3D> 350,=20 -height =3D> 500,=20 -left =3D> 100,=20 -top =3D> 100,=20 );=20 $Window->AddListView(=20 -name =3D> "ListView",=20 -left =3D> 10,=20 -top =3D> 10,=20 -width =3D> 330,=20 -height =3D> 383,=20 -style =3D> WS_VISIBLE | 1,=20 -gridlines =3D> 1,=20 );=20 $width =3D $Window->ListView->ScaleWidth;=20 $Window->ListView->InsertColumn(=20 -index =3D> 0,=20 -width =3D> $width/2,=20 -text =3D> "Asset No",=20 );=20 $Window->ListView->InsertColumn(=20 -index =3D> 1,=20 -width =3D> $width/2,=20 -text =3D> "IP Address",=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio1",=20 -left =3D> 8,=20 -top =3D> 410,=20 -text =3D> "192 Network ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio2",=20 -left =3D> 8,=20 -top =3D> 430,=20 -text =3D> "212 XTML ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio3",=20 -left =3D> 8,=20 -top =3D> 450,=20 -text =3D> "212 EasyNet ",=20 -tabstop =3D> 1,=20 );=20 #$Window->ListView->TextColor(hex("0000FF"));=20 $Window->Show();=20 $Window->Dialog();=20 sub MAIN {=20 #set up dsn=20 Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, = ("DSN=3D$DSN",=20 "Description=3DThe Win32 ODBC Test DSN for Perl", "DBQ=3D$Dir\\$DBase", = "DEFAULTDIR=3D$Dir", "UID=3D", "PWD=3D"));=20 #open connection as $0=20 my $cO =3D new Win32::ODBC($DSN);=20 #run sql=20 $cO->Sql("SELECT assetid, ipaddress FROM ip_address where = ipaddress=20 like '${result}%'");=20 #reset new=20 %new =3D ();=20 # Fetch the next rowset=20 while($cO->FetchRow()){=20 %Data =3D $cO->DataHash();=20 #convert to binary=20 $new{inet_aton($Data{ipaddress})} =3D=20 "$Data{assetid},$Data{ipaddress}";=20 }=20 #close database=20 $cO->Close();=20 #remove tempdsn=20 Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, = "DSN=3D$DSN");=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort keys %new) {=20 my ($asset, $ip ) =3D split(",",$new{$_});=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub MAIN1 {=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort numeric values %new) {=20 my ($asset, $ip ) =3D split(",",$_);=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub numeric { $a <=3D> $b };=20 sub Radio1_Click {=20 if($Window->Radio1->Checked()) {=20 $result =3D "192";=20 &MAIN;=20 } elsif($Window->Radio2->Checked()) {=20 $result =3D "212.88";=20 &MAIN;=20 } elsif($Window->Radio3->Checked()) {=20 $result =3D "212.74";=20 &MAIN;=20 }=20 }=20 sub Radio2_Click { Radio1_Click(); }=20 sub Radio3_Click { Radio1_Click(); }=20 sub ListView_ColumnClick {=20 my $column =3D shift;=20 if ($result ne "" ) {=20 if ( $column =3D=3D 1 ) {&MAIN;}=20 if ( $column =3D=3D 0 ) {&MAIN1;}=20 }=20 =20 }=20 __END__=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are=20 not=20 the named recipient please notify us immediately. You must not copy or = disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 _______________________________________________=20 Perl-Win32-GUI-Users mailing list=20 Per...@li...=20 http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users <http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users> =20 _______________________________________________=20 Perl-Win32-GUI-Users mailing list=20 Per...@li...=20 http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users <http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users> =20 |
From: Erick J. B. <er...@e-...> - 2001-02-16 19:39:04
|
Has anyone had the listview disappear if you try and resize the column? If I resize it, the first time it disappears, the second it reappears but without the scrollbars. Any one else? erick never stop questioning www.jeb.ca |
From: Michael S. <MSo...@3s...> - 2001-02-16 14:55:44
|
I am having problems closing windows I have written a script that pulls up a window and asks for users entry Then it pulls up a second window My problems are that if the user cancels the first window by hitting the close window button X at the top of the window the program doesn't end but still pulls the second window. The second problem is that the first window is still open on the task bar. I could use HideWindow on the first window but that still leaves it open. I would really like to completely kill the first window when I call the second. I hope this make sense The code I am using is as follows: use Win32::GUI; use strict; ########################################################################### #set variables #variables my ($Frame,$title,$assetexist,$assetid); #set font my $font = Win32::GUI::Font->new( -size => 24, -name => "Arial", ); #Enter Asset Number $title = "Asset/Network Entry"; &FRAME; $Frame->AddTextfield( -name => "aTextField", -top => 40, -left => 20, -height => 40, -width => 300, -prompt => "Enter Asset Number", ); #set field text $Frame->aTextField->Text($assetid); #set cursor on field $Frame->aTextField->SetFocus(); $Frame->AddButton( -name => "aButton", -text => "OK", -top => 180, -left => 100, ); $Frame->AddButton( -name => "cancel", -text => "CANCEL", -top => 180, -left => 200, ); #display window $Frame->Show(); Win32::GUI::Dialog(); ########################################################################### #check if asset exists in database if ($assetexist eq "" ) { $title = "No Asset Found"; &FRAME; $Frame->AddLabel( -name => "aTextField", -top => 50, -left => 20, -text => "Asset ID ${assetid} Does not Exist", ); $Frame->AddButton( -name => "cancel", -text => "OK", -top => 180, -left => 150, ); $Frame->Show(); Win32::GUI::Dialog(); } sub aFrame_Terminate { -1; } sub aButton_Click { $assetid=$Frame->aTextField->Text(); if ($assetid ne "") {&aFrame_Terminate}; } sub aButton1_Click { &aFrame_Terminate; } sub cancel_Click { &aFrame_Terminate; exit; } sub FRAME { $Frame = new Win32::GUI::Window( -font => $font, -name => "aFrame", -top => 100, -left => 450, -width => 350, -height => 250, -title => "$title", ); } __END__ Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... ============================================================================ ====== Important: Any views or opinions expressed by the sender do not necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, but it is the responsibility of the recipient to make all the necessary virus checks. www.3s-group.com ========================================================================= |
From: Michael S. <MSo...@3s...> - 2001-02-16 13:57:35
|
Tim, Thanks for your help with this=20 I realised that as I was supplying the data to the list box I just = needed to put it into an array and use: sub ListView_ItemClick { $item =3D shift; print $asset[$item]; =09 } Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D Important: Any views or opinions expressed by the sender do not = necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you = are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please = take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, = but it is the responsibility of the recipient to make all the necessary virus checks.=20 www.3s-group.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D -----Original Message----- From: Thomas, Timothy B [mailto:tim...@lm...]=20 Sent: 15 February 2001 17:45 To: 'per...@li...' Subject: RE: [perl-win32-gui-users] get value from list There is a SelectedItems function you can use. Here's a bit of code that will get the data from all the selected = items. Once you determine which item you have selected you can use that other = piece of code to get the data from every column, or you can use this example = if you just want the first column. see the documentation at http://dada.perl.it/gui_docs/gui.html for more help. if ($ListView->SelectCount() gt 0) { for $i(0..$ListView->SelectCount()-1) { =09 %data=3D$ListView->ItemInfo(($ListView->SelectedItems)[$i]); $filename=3D$data{-text}; ... ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Michael Solomon [mailto:MSo...@3s...] Sent: Thursday, February 15, 2001 10:32 AM To: 'per...@li...' Subject: RE: [perl-win32-gui-users] get value from list Tim,=20 Thanks for this=20 Unfortunately this gets all the items from the list=20 What I want to do is to click on an item in the list and just capture = that=20 For example=20 If I have a list showing=20 1=20 2=20 3=20 if I click on the 3, I want to capture 3=20 I hope this makes sense=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are not=20 the named recipient please notify us immediately. You must not copy or disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 -----Original Message-----=20 From: Thomas, Timothy B [mailto:tim...@lm...]=20 Sent: 15 February 2001 16:48=20 To: 'per...@li...'=20 Subject: RE: [perl-win32-gui-users] get value from list=20 Someone else has written a win32::Gui program to do just what you are = trying to do. I don't seem to have the code anymore. Maybe they can post it = again,=20 or you can search the archives.=20 Here's a piece of code I just wrote that gets all the data, including = the=20 image, from a listview, it puts it into a hash.=20 I used this with the column sort routine that has been floating around, = by=20 Jonathan Southwick [jso...@al...]. I am still working out the = bugs, but this section of code should help you.=20 # you must already have $totalcols (the # of columns in your=20 listview)=20 # I don't think there is a way to pull this from the = object.=20 %data=3D();=20 $rows=3D$ListView->Count();=20 for $i(0..$rows-1)=20 {=20 $row=3D"";=20 my %result=3D$ListView->GetItem($i,0);=20 $image=3D$result{-image};=20 for $j(0..$totalcols-1)=20 {=20 my %result=3D$ListView->GetItem($i,$j);=20 $text=3D$result{-text};=20 $row.=3D",$text";=20 }=20 $data{$i}=3D"$image$row";=20 #Win32::MsgBox("data($i)=3D$image$row\n");=20 }=20 ------------------------------------------------------------------------= ---- ---------------------=20 Tim Thomas=20 Unix Systems Administrator=20 Lockheed Martin EIS =B7 Denver Data Center=20 303-430-2281=20 mailto:tim...@lm...=20 ------------------------------------------------------------------------= ---- ---------------------=20 -----Original Message-----=20 From: Michael Solomon [mailto:MSo...@3s...]=20 Sent: Thursday, February 15, 2001 5:19 AM=20 To: Perl Gui (E-mail)=20 Subject: [perl-win32-gui-users] get value from list=20 I am querying a database and putting the output into a listview=20 What I would like to next is to click on an item in the list and then=20 drilldown into the data base=20 The question is how can I return the value from a List=20 I am fairly new at using Win32::GUI and apologise if this is a stupid=20 question.=20 Should I be using a different type than listview and if so what should = I be=20 using?=20 use strict;=20 use Socket;=20 use Win32::GUI;=20 use Win32::ODBC;=20 #set variables=20 my (%Data, %new, $result, $Window, $width);=20 my $Dir =3D "//neptune/tech_dept/databases";=20 my $DBase =3D "asset.mdb";=20 my $DriverType =3D "Microsoft Access Driver (*.mdb)";=20 my $Desc =3D "Description=3DThe Win32::ODBC Test DSN for = Perl";=20 my $DSN =3D "tmpdsn";=20 $Window =3D new GUI::Window(=20 -name =3D> "Window",=20 -text =3D> "Win32::GUI::ListView test",=20 -width =3D> 350,=20 -height =3D> 500,=20 -left =3D> 100,=20 -top =3D> 100,=20 );=20 $Window->AddListView(=20 -name =3D> "ListView",=20 -left =3D> 10,=20 -top =3D> 10,=20 -width =3D> 330,=20 -height =3D> 383,=20 -style =3D> WS_VISIBLE | 1,=20 -gridlines =3D> 1,=20 );=20 $width =3D $Window->ListView->ScaleWidth;=20 $Window->ListView->InsertColumn(=20 -index =3D> 0,=20 -width =3D> $width/2,=20 -text =3D> "Asset No",=20 );=20 $Window->ListView->InsertColumn(=20 -index =3D> 1,=20 -width =3D> $width/2,=20 -text =3D> "IP Address",=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio1",=20 -left =3D> 8,=20 -top =3D> 410,=20 -text =3D> "192 Network ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio2",=20 -left =3D> 8,=20 -top =3D> 430,=20 -text =3D> "212 XTML ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio3",=20 -left =3D> 8,=20 -top =3D> 450,=20 -text =3D> "212 EasyNet ",=20 -tabstop =3D> 1,=20 );=20 #$Window->ListView->TextColor(hex("0000FF"));=20 $Window->Show();=20 $Window->Dialog();=20 sub MAIN {=20 #set up dsn=20 Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, = ("DSN=3D$DSN",=20 "Description=3DThe Win32 ODBC Test DSN for Perl", "DBQ=3D$Dir\\$DBase", = "DEFAULTDIR=3D$Dir", "UID=3D", "PWD=3D"));=20 #open connection as $0=20 my $cO =3D new Win32::ODBC($DSN);=20 #run sql=20 $cO->Sql("SELECT assetid, ipaddress FROM ip_address where = ipaddress=20 like '${result}%'");=20 #reset new=20 %new =3D ();=20 # Fetch the next rowset=20 while($cO->FetchRow()){=20 %Data =3D $cO->DataHash();=20 #convert to binary=20 $new{inet_aton($Data{ipaddress})} =3D=20 "$Data{assetid},$Data{ipaddress}";=20 }=20 #close database=20 $cO->Close();=20 #remove tempdsn=20 Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, = "DSN=3D$DSN");=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort keys %new) {=20 my ($asset, $ip ) =3D split(",",$new{$_});=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub MAIN1 {=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort numeric values %new) {=20 my ($asset, $ip ) =3D split(",",$_);=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub numeric { $a <=3D> $b };=20 sub Radio1_Click {=20 if($Window->Radio1->Checked()) {=20 $result =3D "192";=20 &MAIN;=20 } elsif($Window->Radio2->Checked()) {=20 $result =3D "212.88";=20 &MAIN;=20 } elsif($Window->Radio3->Checked()) {=20 $result =3D "212.74";=20 &MAIN;=20 }=20 }=20 sub Radio2_Click { Radio1_Click(); }=20 sub Radio3_Click { Radio1_Click(); }=20 sub ListView_ColumnClick {=20 my $column =3D shift;=20 if ($result ne "" ) {=20 if ( $column =3D=3D 1 ) {&MAIN;}=20 if ( $column =3D=3D 0 ) {&MAIN1;}=20 }=20 =20 }=20 __END__=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are=20 not=20 the named recipient please notify us immediately. You must not copy or = disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 _______________________________________________=20 Perl-Win32-GUI-Users mailing list=20 Per...@li...=20 http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users=20 _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Thomas, T. B <tim...@lm...> - 2001-02-15 17:51:55
|
There is a SelectedItems function you can use. Here's a bit of code that will get the data from all the selected = items. Once you determine which item you have selected you can use that other = piece of code to get the data from every column, or you can use this example = if you just want the first column. see the documentation at http://dada.perl.it/gui_docs/gui.html for more help. if ($ListView->SelectCount() gt 0) { for $i(0..$ListView->SelectCount()-1) { =09 %data=3D$ListView->ItemInfo(($ListView->SelectedItems)[$i]); $filename=3D$data{-text}; ... ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Michael Solomon [mailto:MSo...@3s...] Sent: Thursday, February 15, 2001 10:32 AM To: 'per...@li...' Subject: RE: [perl-win32-gui-users] get value from list Tim,=20 Thanks for this=20 Unfortunately this gets all the items from the list=20 What I want to do is to click on an item in the list and just capture = that=20 For example=20 If I have a list showing=20 1=20 2=20 3=20 if I click on the 3, I want to capture 3=20 I hope this makes sense=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are not=20 the named recipient please notify us immediately. You must not copy or disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 -----Original Message-----=20 From: Thomas, Timothy B [mailto:tim...@lm...]=20 Sent: 15 February 2001 16:48=20 To: 'per...@li...'=20 Subject: RE: [perl-win32-gui-users] get value from list=20 Someone else has written a win32::Gui program to do just what you are = trying to do. I don't seem to have the code anymore. Maybe they can post it = again,=20 or you can search the archives.=20 Here's a piece of code I just wrote that gets all the data, including = the=20 image, from a listview, it puts it into a hash.=20 I used this with the column sort routine that has been floating around, = by=20 Jonathan Southwick [jso...@al...]. I am still working out the = bugs, but this section of code should help you.=20 # you must already have $totalcols (the # of columns in your=20 listview)=20 # I don't think there is a way to pull this from the = object.=20 %data=3D();=20 $rows=3D$ListView->Count();=20 for $i(0..$rows-1)=20 {=20 $row=3D"";=20 my %result=3D$ListView->GetItem($i,0);=20 $image=3D$result{-image};=20 for $j(0..$totalcols-1)=20 {=20 my %result=3D$ListView->GetItem($i,$j);=20 $text=3D$result{-text};=20 $row.=3D",$text";=20 }=20 $data{$i}=3D"$image$row";=20 #Win32::MsgBox("data($i)=3D$image$row\n");=20 }=20 ------------------------------------------------------------------------= ---- ---------------------=20 Tim Thomas=20 Unix Systems Administrator=20 Lockheed Martin EIS =B7 Denver Data Center=20 303-430-2281=20 mailto:tim...@lm...=20 ------------------------------------------------------------------------= ---- ---------------------=20 -----Original Message-----=20 From: Michael Solomon [mailto:MSo...@3s...]=20 Sent: Thursday, February 15, 2001 5:19 AM=20 To: Perl Gui (E-mail)=20 Subject: [perl-win32-gui-users] get value from list=20 I am querying a database and putting the output into a listview=20 What I would like to next is to click on an item in the list and then=20 drilldown into the data base=20 The question is how can I return the value from a List=20 I am fairly new at using Win32::GUI and apologise if this is a stupid=20 question.=20 Should I be using a different type than listview and if so what should = I be=20 using?=20 use strict;=20 use Socket;=20 use Win32::GUI;=20 use Win32::ODBC;=20 #set variables=20 my (%Data, %new, $result, $Window, $width);=20 my $Dir =3D "//neptune/tech_dept/databases";=20 my $DBase =3D "asset.mdb";=20 my $DriverType =3D "Microsoft Access Driver (*.mdb)";=20 my $Desc =3D "Description=3DThe Win32::ODBC Test DSN for = Perl";=20 my $DSN =3D "tmpdsn";=20 $Window =3D new GUI::Window(=20 -name =3D> "Window",=20 -text =3D> "Win32::GUI::ListView test",=20 -width =3D> 350,=20 -height =3D> 500,=20 -left =3D> 100,=20 -top =3D> 100,=20 );=20 $Window->AddListView(=20 -name =3D> "ListView",=20 -left =3D> 10,=20 -top =3D> 10,=20 -width =3D> 330,=20 -height =3D> 383,=20 -style =3D> WS_VISIBLE | 1,=20 -gridlines =3D> 1,=20 );=20 $width =3D $Window->ListView->ScaleWidth;=20 $Window->ListView->InsertColumn(=20 -index =3D> 0,=20 -width =3D> $width/2,=20 -text =3D> "Asset No",=20 );=20 $Window->ListView->InsertColumn(=20 -index =3D> 1,=20 -width =3D> $width/2,=20 -text =3D> "IP Address",=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio1",=20 -left =3D> 8,=20 -top =3D> 410,=20 -text =3D> "192 Network ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio2",=20 -left =3D> 8,=20 -top =3D> 430,=20 -text =3D> "212 XTML ",=20 -tabstop =3D> 1,=20 );=20 $Window->AddRadioButton(=20 -name =3D> "Radio3",=20 -left =3D> 8,=20 -top =3D> 450,=20 -text =3D> "212 EasyNet ",=20 -tabstop =3D> 1,=20 );=20 #$Window->ListView->TextColor(hex("0000FF"));=20 $Window->Show();=20 $Window->Dialog();=20 sub MAIN {=20 #set up dsn=20 Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, = ("DSN=3D$DSN",=20 "Description=3DThe Win32 ODBC Test DSN for Perl", "DBQ=3D$Dir\\$DBase", = "DEFAULTDIR=3D$Dir", "UID=3D", "PWD=3D"));=20 #open connection as $0=20 my $cO =3D new Win32::ODBC($DSN);=20 #run sql=20 $cO->Sql("SELECT assetid, ipaddress FROM ip_address where = ipaddress=20 like '${result}%'");=20 #reset new=20 %new =3D ();=20 # Fetch the next rowset=20 while($cO->FetchRow()){=20 %Data =3D $cO->DataHash();=20 #convert to binary=20 $new{inet_aton($Data{ipaddress})} =3D=20 "$Data{assetid},$Data{ipaddress}";=20 }=20 #close database=20 $cO->Close();=20 #remove tempdsn=20 Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, = "DSN=3D$DSN");=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort keys %new) {=20 my ($asset, $ip ) =3D split(",",$new{$_});=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub MAIN1 {=20 #clear items=20 $Window->ListView->Clear(); =20 foreach (sort numeric values %new) {=20 my ($asset, $ip ) =3D split(",",$_);=20 $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ]=20 );=20 };=20 }=20 sub numeric { $a <=3D> $b };=20 sub Radio1_Click {=20 if($Window->Radio1->Checked()) {=20 $result =3D "192";=20 &MAIN;=20 } elsif($Window->Radio2->Checked()) {=20 $result =3D "212.88";=20 &MAIN;=20 } elsif($Window->Radio3->Checked()) {=20 $result =3D "212.74";=20 &MAIN;=20 }=20 }=20 sub Radio2_Click { Radio1_Click(); }=20 sub Radio3_Click { Radio1_Click(); }=20 sub ListView_ColumnClick {=20 my $column =3D shift;=20 if ($result ne "" ) {=20 if ( $column =3D=3D 1 ) {&MAIN;}=20 if ( $column =3D=3D 0 ) {&MAIN1;}=20 }=20 =20 }=20 __END__=20 Regards=20 Mike Solomon=20 Technical Manager=20 Work 01582 831125=20 Mobile 07941 537 172=20 email mso...@3s...=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=20 Important: Any views or opinions expressed by the sender do not = necessarily=20 represent those of the 3s Group. This e-mail and any attachment(s)=20 are intended for the above named only and may be confidential. If you = are=20 not=20 the named recipient please notify us immediately. You must not copy or = disclose=20 the contents to any third party.=20 Internet e-mail is not a fully secure communications medium. Please = take=20 this into account when sending e-mail to us.=20 Any attachment(s) to this e-mail are believed to be free from virus, = but it=20 is the responsibility of the recipient to make all the necessary virus=20 checks.=20 www.3s-group.com=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=20 _______________________________________________=20 Perl-Win32-GUI-Users mailing list=20 Per...@li...=20 http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users=20 |
From: Michael S. <MSo...@3s...> - 2001-02-15 17:31:06
|
Tim, Thanks for this Unfortunately this gets all the items from the list What I want to do is to click on an item in the list and just capture = that For example If I have a list showing 1 2 3 if I click on the 3, I want to capture 3 I hope this makes sense Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D Important: Any views or opinions expressed by the sender do not = necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you = are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please = take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, = but it is the responsibility of the recipient to make all the necessary virus checks.=20 www.3s-group.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D -----Original Message----- From: Thomas, Timothy B [mailto:tim...@lm...]=20 Sent: 15 February 2001 16:48 To: 'per...@li...' Subject: RE: [perl-win32-gui-users] get value from list Someone else has written a win32::Gui program to do just what you are = trying to do. I don't seem to have the code anymore. Maybe they can post it = again, or you can search the archives. Here's a piece of code I just wrote that gets all the data, including = the image, from a listview, it puts it into a hash. I used this with the column sort routine that has been floating around, = by Jonathan Southwick [jso...@al...]. I am still working out the bugs, but this section of code should help you. # you must already have $totalcols (the # of columns in your listview) # I don't think there is a way to pull this from the object. %data=3D(); $rows=3D$ListView->Count(); for $i(0..$rows-1) { $row=3D""; my %result=3D$ListView->GetItem($i,0); $image=3D$result{-image}; for $j(0..$totalcols-1) { my %result=3D$ListView->GetItem($i,$j); $text=3D$result{-text}; $row.=3D",$text"; } $data{$i}=3D"$image$row"; #Win32::MsgBox("data($i)=3D$image$row\n"); } ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Michael Solomon [mailto:MSo...@3s...] Sent: Thursday, February 15, 2001 5:19 AM To: Perl Gui (E-mail) Subject: [perl-win32-gui-users] get value from list I am querying a database and putting the output into a listview What I would like to next is to click on an item in the list and then drilldown into the data base The question is how can I return the value from a List I am fairly new at using Win32::GUI and apologise if this is a stupid question. Should I be using a different type than listview and if so what should = I be using? use strict; use Socket; use Win32::GUI; use Win32::ODBC; #set variables my (%Data, %new, $result, $Window, $width); my $Dir =3D "//neptune/tech_dept/databases"; my $DBase =3D "asset.mdb"; my $DriverType =3D "Microsoft Access Driver (*.mdb)"; my $Desc =3D "Description=3DThe Win32::ODBC Test DSN for = Perl"; my $DSN =3D "tmpdsn"; $Window =3D new GUI::Window( -name =3D> "Window", -text =3D> "Win32::GUI::ListView test", -width =3D> 350, -height =3D> 500, -left =3D> 100, -top =3D> 100, ); $Window->AddListView( -name =3D> "ListView", -left =3D> 10, -top =3D> 10, -width =3D> 330, -height =3D> 383, -style =3D> WS_VISIBLE | 1, -gridlines =3D> 1, ); $width =3D $Window->ListView->ScaleWidth; $Window->ListView->InsertColumn( -index =3D> 0, -width =3D> $width/2, -text =3D> "Asset No", ); $Window->ListView->InsertColumn( -index =3D> 1, -width =3D> $width/2, -text =3D> "IP Address", ); $Window->AddRadioButton( -name =3D> "Radio1", -left =3D> 8, -top =3D> 410, -text =3D> "192 Network ", -tabstop =3D> 1, ); $Window->AddRadioButton( -name =3D> "Radio2", -left =3D> 8, -top =3D> 430, -text =3D> "212 XTML ", -tabstop =3D> 1, ); $Window->AddRadioButton( -name =3D> "Radio3", -left =3D> 8, -top =3D> 450, -text =3D> "212 EasyNet ", -tabstop =3D> 1, ); #$Window->ListView->TextColor(hex("0000FF")); $Window->Show(); $Window->Dialog(); sub MAIN { #set up dsn Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, = ("DSN=3D$DSN", "Description=3DThe Win32 ODBC Test DSN for Perl", "DBQ=3D$Dir\\$DBase", "DEFAULTDIR=3D$Dir", "UID=3D", "PWD=3D")); #open connection as $0 my $cO =3D new Win32::ODBC($DSN); #run sql $cO->Sql("SELECT assetid, ipaddress FROM ip_address where = ipaddress like '${result}%'"); #reset new %new =3D (); # Fetch the next rowset while($cO->FetchRow()){ %Data =3D $cO->DataHash(); #convert to binary $new{inet_aton($Data{ipaddress})} =3D "$Data{assetid},$Data{ipaddress}"; } #close database $cO->Close(); #remove tempdsn Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, = "DSN=3D$DSN"); #clear items $Window->ListView->Clear(); =20 foreach (sort keys %new) { my ($asset, $ip ) =3D split(",",$new{$_}); $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ] ); }; } sub MAIN1 { #clear items $Window->ListView->Clear(); =20 foreach (sort numeric values %new) { my ($asset, $ip ) =3D split(",",$_); $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ] ); }; } sub numeric { $a <=3D> $b }; sub Radio1_Click { if($Window->Radio1->Checked()) { $result =3D "192"; &MAIN; } elsif($Window->Radio2->Checked()) { $result =3D "212.88"; &MAIN; } elsif($Window->Radio3->Checked()) { $result =3D "212.74"; &MAIN; } } sub Radio2_Click { Radio1_Click(); } sub Radio3_Click { Radio1_Click(); } sub ListView_ColumnClick { my $column =3D shift; if ($result ne "" ) { if ( $column =3D=3D 1 ) {&MAIN;} if ( $column =3D=3D 0 ) {&MAIN1;} } =20 } __END__ Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D Important: Any views or opinions expressed by the sender do not = necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you = are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please = take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, = but it is the responsibility of the recipient to make all the necessary virus checks.=20 www.3s-group.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users |
From: Aldo C. <da...@pe...> - 2001-02-15 17:21:10
|
Erick J. Bourgeois wrote: > XSRETURN_NO; #Is the problem here?# exxxactly, should be XSRETURN_UNDEF; instead. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Aldo C. <da...@pe...> - 2001-02-15 17:18:15
|
Erick J. Bourgeois wrote: > Aldo, can I correct it myself and compile it with DJGCC? I hope so :-) I could not compile it with cygwin's gcc, but I'll be very happy to know how it goes with djgcc. but please post build reports and pleas for help on the Perl-Win32-GUI-Hackers mailing list, since this is a topic that doesn't interest general Win32::GUI usage. cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Erick J. B. <er...@e-...> - 2001-02-15 17:10:40
|
Aldo, I had a look at the GUI.XS (Version: 0.0.558) and I found the following lines (at line: 9930~) for SelectedItems return: scount = ListView_GetSelectedCount(handle); if(scount > 0) { index = -1; tcount = 0; EXTEND(SP, scount); index = ListView_GetNextItem(handle, index, LVNI_SELECTED); while(tcount < scount && index != -1) { XST_mIV(tcount, (long) index); tcount++; index = ListView_GetNextItem(handle, index, LVNI_SELECTED); } XSRETURN(scount); } else { XSRETURN_NO; #Is the problem here?# } erick never stop questioning www.jeb.ca |
From: Thomas, T. B <tim...@lm...> - 2001-02-15 16:59:49
|
Someone else has written a win32::Gui program to do just what you are = trying to do. I don't seem to have the code anymore. Maybe they can post it = again, or you can search the archives. Here's a piece of code I just wrote that gets all the data, including = the image, from a listview, it puts it into a hash. I used this with the column sort routine that has been floating around, = by Jonathan Southwick [jso...@al...]. I am still working out the bugs, but this section of code should help you. # you must already have $totalcols (the # of columns in your listview) # I don't think there is a way to pull this from the object. %data=3D(); $rows=3D$ListView->Count(); for $i(0..$rows-1) { $row=3D""; my %result=3D$ListView->GetItem($i,0); $image=3D$result{-image}; for $j(0..$totalcols-1) { my %result=3D$ListView->GetItem($i,$j); $text=3D$result{-text}; $row.=3D",$text"; } $data{$i}=3D"$image$row"; #Win32::MsgBox("data($i)=3D$image$row\n"); } ------------------------------------------------------------------------= ---- --------------------- Tim Thomas Unix Systems Administrator Lockheed Martin EIS =B7 Denver Data Center 303-430-2281 mailto:tim...@lm... ------------------------------------------------------------------------= ---- --------------------- -----Original Message----- From: Michael Solomon [mailto:MSo...@3s...] Sent: Thursday, February 15, 2001 5:19 AM To: Perl Gui (E-mail) Subject: [perl-win32-gui-users] get value from list I am querying a database and putting the output into a listview What I would like to next is to click on an item in the list and then drilldown into the data base The question is how can I return the value from a List I am fairly new at using Win32::GUI and apologise if this is a stupid question. Should I be using a different type than listview and if so what should = I be using? use strict; use Socket; use Win32::GUI; use Win32::ODBC; #set variables my (%Data, %new, $result, $Window, $width); my $Dir =3D "//neptune/tech_dept/databases"; my $DBase =3D "asset.mdb"; my $DriverType =3D "Microsoft Access Driver (*.mdb)"; my $Desc =3D "Description=3DThe Win32::ODBC Test DSN for = Perl"; my $DSN =3D "tmpdsn"; $Window =3D new GUI::Window( -name =3D> "Window", -text =3D> "Win32::GUI::ListView test", -width =3D> 350, -height =3D> 500, -left =3D> 100, -top =3D> 100, ); $Window->AddListView( -name =3D> "ListView", -left =3D> 10, -top =3D> 10, -width =3D> 330, -height =3D> 383, -style =3D> WS_VISIBLE | 1, -gridlines =3D> 1, ); $width =3D $Window->ListView->ScaleWidth; $Window->ListView->InsertColumn( -index =3D> 0, -width =3D> $width/2, -text =3D> "Asset No", ); $Window->ListView->InsertColumn( -index =3D> 1, -width =3D> $width/2, -text =3D> "IP Address", ); $Window->AddRadioButton( -name =3D> "Radio1", -left =3D> 8, -top =3D> 410, -text =3D> "192 Network ", -tabstop =3D> 1, ); $Window->AddRadioButton( -name =3D> "Radio2", -left =3D> 8, -top =3D> 430, -text =3D> "212 XTML ", -tabstop =3D> 1, ); $Window->AddRadioButton( -name =3D> "Radio3", -left =3D> 8, -top =3D> 450, -text =3D> "212 EasyNet ", -tabstop =3D> 1, ); #$Window->ListView->TextColor(hex("0000FF")); $Window->Show(); $Window->Dialog(); sub MAIN { #set up dsn Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, = ("DSN=3D$DSN", "Description=3DThe Win32 ODBC Test DSN for Perl", "DBQ=3D$Dir\\$DBase", "DEFAULTDIR=3D$Dir", "UID=3D", "PWD=3D")); #open connection as $0 my $cO =3D new Win32::ODBC($DSN); #run sql $cO->Sql("SELECT assetid, ipaddress FROM ip_address where = ipaddress like '${result}%'"); #reset new %new =3D (); # Fetch the next rowset while($cO->FetchRow()){ %Data =3D $cO->DataHash(); #convert to binary $new{inet_aton($Data{ipaddress})} =3D "$Data{assetid},$Data{ipaddress}"; } #close database $cO->Close(); #remove tempdsn Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, = "DSN=3D$DSN"); #clear items $Window->ListView->Clear(); =20 foreach (sort keys %new) { my ($asset, $ip ) =3D split(",",$new{$_}); $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ] ); }; } sub MAIN1 { #clear items $Window->ListView->Clear(); =20 foreach (sort numeric values %new) { my ($asset, $ip ) =3D split(",",$_); $Window->ListView->InsertItem(-text =3D> [ "$asset", = "$ip" ] ); }; } sub numeric { $a <=3D> $b }; sub Radio1_Click { if($Window->Radio1->Checked()) { $result =3D "192"; &MAIN; } elsif($Window->Radio2->Checked()) { $result =3D "212.88"; &MAIN; } elsif($Window->Radio3->Checked()) { $result =3D "212.74"; &MAIN; } } sub Radio2_Click { Radio1_Click(); } sub Radio3_Click { Radio1_Click(); } sub ListView_ColumnClick { my $column =3D shift; if ($result ne "" ) { if ( $column =3D=3D 1 ) {&MAIN;} if ( $column =3D=3D 0 ) {&MAIN1;} } =20 } __END__ Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D Important: Any views or opinions expressed by the sender do not = necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you = are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please = take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, = but it is the responsibility of the recipient to make all the necessary virus checks.=20 www.3s-group.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D |
From: Erick J. B. <er...@e-...> - 2001-02-15 16:02:00
|
Aldo, can I correct it myself and compile it with DJGCC? erick never stop questioning www.jeb.ca |
From: Aldo C. <da...@pe...> - 2001-02-15 15:27:00
|
Erick J. Bourgeois wrote: > Sorry to bother the list again, but Aldo, checking it's > undef"ness" with defined does not work either, it falls > through not matter what. I tried putting print > "$index[0]\n"; to see it's value and indeed it is undef (ie. > it did not print anything), so why does it pass the if > statement? that's true, there's a bug in the XS code: it doesn't really returns undef, but a false value (eg. 0). will be corrected in the next release :-) cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Michael S. <MSo...@3s...> - 2001-02-15 12:17:53
|
I am querying a database and putting the output into a listview What I would like to next is to click on an item in the list and then drilldown into the data base The question is how can I return the value from a List I am fairly new at using Win32::GUI and apologise if this is a stupid question. Should I be using a different type than listview and if so what should I be using? use strict; use Socket; use Win32::GUI; use Win32::ODBC; #set variables my (%Data, %new, $result, $Window, $width); my $Dir = "//neptune/tech_dept/databases"; my $DBase = "asset.mdb"; my $DriverType = "Microsoft Access Driver (*.mdb)"; my $Desc = "Description=The Win32::ODBC Test DSN for Perl"; my $DSN = "tmpdsn"; $Window = new GUI::Window( -name => "Window", -text => "Win32::GUI::ListView test", -width => 350, -height => 500, -left => 100, -top => 100, ); $Window->AddListView( -name => "ListView", -left => 10, -top => 10, -width => 330, -height => 383, -style => WS_VISIBLE | 1, -gridlines => 1, ); $width = $Window->ListView->ScaleWidth; $Window->ListView->InsertColumn( -index => 0, -width => $width/2, -text => "Asset No", ); $Window->ListView->InsertColumn( -index => 1, -width => $width/2, -text => "IP Address", ); $Window->AddRadioButton( -name => "Radio1", -left => 8, -top => 410, -text => "192 Network ", -tabstop => 1, ); $Window->AddRadioButton( -name => "Radio2", -left => 8, -top => 430, -text => "212 XTML ", -tabstop => 1, ); $Window->AddRadioButton( -name => "Radio3", -left => 8, -top => 450, -text => "212 EasyNet ", -tabstop => 1, ); #$Window->ListView->TextColor(hex("0000FF")); $Window->Show(); $Window->Dialog(); sub MAIN { #set up dsn Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType, ("DSN=$DSN", "Description=The Win32 ODBC Test DSN for Perl", "DBQ=$Dir\\$DBase", "DEFAULTDIR=$Dir", "UID=", "PWD=")); #open connection as $0 my $cO = new Win32::ODBC($DSN); #run sql $cO->Sql("SELECT assetid, ipaddress FROM ip_address where ipaddress like '${result}%'"); #reset new %new = (); # Fetch the next rowset while($cO->FetchRow()){ %Data = $cO->DataHash(); #convert to binary $new{inet_aton($Data{ipaddress})} = "$Data{assetid},$Data{ipaddress}"; } #close database $cO->Close(); #remove tempdsn Win32::ODBC::ConfigDSN(ODBC_REMOVE_DSN, $DriverType, "DSN=$DSN"); #clear items $Window->ListView->Clear(); foreach (sort keys %new) { my ($asset, $ip ) = split(",",$new{$_}); $Window->ListView->InsertItem(-text => [ "$asset", "$ip" ] ); }; } sub MAIN1 { #clear items $Window->ListView->Clear(); foreach (sort numeric values %new) { my ($asset, $ip ) = split(",",$_); $Window->ListView->InsertItem(-text => [ "$asset", "$ip" ] ); }; } sub numeric { $a <=> $b }; sub Radio1_Click { if($Window->Radio1->Checked()) { $result = "192"; &MAIN; } elsif($Window->Radio2->Checked()) { $result = "212.88"; &MAIN; } elsif($Window->Radio3->Checked()) { $result = "212.74"; &MAIN; } } sub Radio2_Click { Radio1_Click(); } sub Radio3_Click { Radio1_Click(); } sub ListView_ColumnClick { my $column = shift; if ($result ne "" ) { if ( $column == 1 ) {&MAIN;} if ( $column == 0 ) {&MAIN1;} } } __END__ Regards Mike Solomon Technical Manager Work 01582 831125 Mobile 07941 537 172 email mso...@3s... ============================================================================ ====== Important: Any views or opinions expressed by the sender do not necessarily represent those of the 3s Group. This e-mail and any attachment(s) are intended for the above named only and may be confidential. If you are not the named recipient please notify us immediately. You must not copy or disclose the contents to any third party. Internet e-mail is not a fully secure communications medium. Please take this into account when sending e-mail to us. Any attachment(s) to this e-mail are believed to be free from virus, but it is the responsibility of the recipient to make all the necessary virus checks. www.3s-group.com ========================================================================= |
From: Erick J. B. <er...@e-...> - 2001-02-15 11:24:19
|
Sorry to bother the list again, but Aldo, checking it's undef"ness" with defined does not work either, it falls through not matter what. I tried putting print "$index[0]\n"; to see it's value and indeed it is undef (ie. it did not print anything), so why does it pass the if statement? erick never stop questioning www.jeb.ca |
From: Erick J. B. <er...@e-...> - 2001-02-15 11:14:28
|
> UNDEF IS NOT THE SAME AS 0! this is, speaking in perl terms, > an heresy and you shall be punished with eternal fire ;-) Mia colpa, mia colpa...won't happen again :) erick never stop questioning www.jeb.ca |
From: Aldo C. <da...@pe...> - 2001-02-15 10:12:41
|
Erick J. Bourgeois wrote: > [...] > When "Button" is pressed it always falls through the if > statement. Even in the case of no selection it falls through > because @index[0], in this case, is undef. I know undef is > the same as 0, but how could I get around this? UNDEF IS NOT THE SAME AS 0! this is, speaking in perl terms, an heresy and you shall be punished with eternal fire ;-) undef is *evaluated* as 0 in numerical context and as "" in string context, but is not 'the same'. perl has a defined() function to check if something is 'not undef', including 0 and "". your if statement should look like this: if( defined( $index[0] ) ) { cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Erick J. B. <er...@e-...> - 2001-02-14 23:21:47
|
Jeremy, sorry what I gave was a typo, I did indeed have $Index[0] (Cutting and pasting error :) ). It should look like this: $MainWin->AddListView( -name => "ListView", -pos => [85, 100], -size => [$MainWin->ScaleWidth-160,$MainWin->ScaleHeight-170], -style => WS_CHILD | WS_VISIBLE | 1 |WS_HSCROLL | WS_VSCROLL, -fullrowselect => -1, -gridlines => 0, -hottrack => 0, -visible => 0, -view => 1, -tabstop => 4, -singlesel => 1, ); $width = $MainWin->ListView->ScaleWidth; $MainWin->ListView->InsertColumn( -index => 0, -subitem => 0, -width => $width-15, -text => "Column", ); for (sort keys %SomeHash) { $MainWin->ListView->InsertItem(-text=>[$_]); } $MainWin->AddButton( -name => "Button", -text => "&Ok", -pos => [347, 350], -height => 20, ); sub Button_Click { my @index = $MainWin->ListView->SelectedItems(); if ($index[0] >= 0) { #I need the zero because of the zero-based index #do something... } else { Win32::MsgBox(...); } Any more ideas are more than welcome. erick never stop questioning www.jeb.ca ----- Original Message ----- From: Jeremy Blonde <sco...@ya...> To: <per...@li...> Sent: Wednesday, February 14, 2001 11:04 PM Subject: Re: [perl-win32-gui-users] SelectedItems method > Well, I don't know if this will actually fix your > problem, but you should definitely be using > "$index[0]" instead of "@index[0]". > > Just my 2 cents, > jb > |
From: Jeremy B. <sco...@ya...> - 2001-02-14 22:03:38
|
Well, I don't know if this will actually fix your problem, but you should definitely be using "$index[0]" instead of "@index[0]". Just my 2 cents, jb --- "Erick J. Bourgeois" <er...@e-...> wrote: > I'm trying to test if any items have been selected > in a > listview with a button event and I have used the > -singlesel > option on the listview. So, therefore, if the user > clicks > the button without selecting anything, I would like > to have > a MsgBox, else take the value of the the choosen > selection > and do some computation. > > $MainWin->AddListView( > -name => "ListView", > -pos => [85, 100], > -size => [$MainWin->ScaleWidth-160, > $MainWin->ScaleHeight-170], > -style => WS_CHILD | WS_VISIBLE | 1 > | > WS_HSCROLL | WS_VSCROLL, > -fullrowselect => -1, > -gridlines => 0, > -hottrack => 0, > -visible => 0, > -view => 1, > -tabstop => 4, > -singlesel => 1, > ); > $width = $MainWin->ListView->ScaleWidth; > $MainWin->ListView->InsertColumn( > -index => 0, > -subitem => 0, > -width => $width-15, > -text => "Column", > ); > for (sort keys %SomeHash) { > $MainWin->ListView->InsertItem(-text=>[$_]); > } > $MainWin->AddButton( > -name => "Button", > -text => "&Ok", > -pos => [347, 350], > -height => 20, > ); > > sub Button_Click { > my @index = $MainWin->ListView->SelectedItems(); > if (@index[0] >= 0) { #I need the zero because > of the > zero-based index > #do something... > } else { > Win32::MsgBox(...); > } > > When "Button" is pressed it always falls through the > if > statement. Even in the case of no selection it falls > through > because @index[0], in this case, is undef. I know > undef is > the same as 0, but how could I get around this? > > erick > never stop questioning > www.jeb.ca > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Erick J. B. <er...@e-...> - 2001-02-14 19:16:30
|
I'm trying to test if any items have been selected in a listview with a button event and I have used the -singlesel option on the listview. So, therefore, if the user clicks the button without selecting anything, I would like to have a MsgBox, else take the value of the the choosen selection and do some computation. $MainWin->AddListView( -name => "ListView", -pos => [85, 100], -size => [$MainWin->ScaleWidth-160, $MainWin->ScaleHeight-170], -style => WS_CHILD | WS_VISIBLE | 1 | WS_HSCROLL | WS_VSCROLL, -fullrowselect => -1, -gridlines => 0, -hottrack => 0, -visible => 0, -view => 1, -tabstop => 4, -singlesel => 1, ); $width = $MainWin->ListView->ScaleWidth; $MainWin->ListView->InsertColumn( -index => 0, -subitem => 0, -width => $width-15, -text => "Column", ); for (sort keys %SomeHash) { $MainWin->ListView->InsertItem(-text=>[$_]); } $MainWin->AddButton( -name => "Button", -text => "&Ok", -pos => [347, 350], -height => 20, ); sub Button_Click { my @index = $MainWin->ListView->SelectedItems(); if (@index[0] >= 0) { #I need the zero because of the zero-based index #do something... } else { Win32::MsgBox(...); } When "Button" is pressed it always falls through the if statement. Even in the case of no selection it falls through because @index[0], in this case, is undef. I know undef is the same as 0, but how could I get around this? erick never stop questioning www.jeb.ca |
From: christopher s. <chr...@ya...> - 2001-02-14 15:51:23
|
Thanks aldo for all your info chris www.perl-resume.com ----- Original Message ----- From: Aldo Calpini <da...@pe...> To: christopher sagayam <per...@li...> Sent: Wednesday, February 14, 2001 6:59 PM Subject: Re: [perl-win32-gui-users] looping in win32 GUI christopher sagayam wrote: > Here is what Im trying to do > > I am trying to write a win32 gui perl client which when started > will check whether the computer is connected to internet > continuously indefinety in the meantime other actions should > proceed also > > So based on your previous example actually there wont be a STOP > button at all since this loop is going to be continuouly executed > as along as the win32 gui script is running > > now the catch is during the time the loop is running I need to > catch key presses , button presses , tab presses etc too and do > it efficiently I see. in this case, the best thing to do is to setup a Timer object with a small interval and do your connectivity test once inside its Timer event, no loop, no sleep :-) cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: Aldo C. <da...@pe...> - 2001-02-14 15:44:40
|
Nahum Marc wrote: > Win32::GUI version 0.0.502 > perl version Binary build 522 > OS : Windows NT4 wks , SP5 c'est tres simple :-) your window is called 'Win' (-name => "Win"), but your event is called Window_Terminate. should be Win_Terminate instead! BTW, you have an horrible use of goto in your script. I haven't investigated much, but I've seen a lot of possible problems here and there (for example, returning to 'debut' will create another copy of your windows, which is something you should not do!). cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: <se...@la...> - 2001-02-14 15:24:37
|
On 14 Feb 2001, at 11:20, Nahum Marc wrote: > How to manage the the cancel cross (upper right) in GUI to do an exit > ? = , not a window exit , but a script exit ... I think I found your problem: When Win32::GUI::Dialog() returns -1, control returns to the script. After that, you have a bunch of subs and then your 'suite' section. One of the commands in 'suite' is 'goto debut', so it jumps back up there, and runs through that part of the script again. Place an 'exit' after your Win32::GUI::Dialog(), and the script should terminate before getting to 'suite'. |
From: Nahum M. <Mar...@re...> - 2001-02-14 14:58:41
|
Win32::GUI version 0.0.502 perl version Binary build 522 OS : Windows NT4 wks , SP5 Sincerly, Marc Nahum ----- Original Message ----- From: "Aldo Calpini" <da...@pe...> To: "Nahum Marc" <per...@li...> Sent: Wednesday, February 14, 2001 2:57 PM Subject: Re: [perl-win32-gui-users] The cancel cross (upper right) in GUI > Nahum Marc wrote: > > I do this too ... but it's close the window , and not all the > > script ... I can see the process yet in task manager (under NT4) > > > > off course , i hide the dos box so , i need kill the process > > there must be some error in your script. can you post a piece of > your code that includes at least the window creation, the > Win32::GUI::Dialog() call and the Terminate event? > > also, please report which version of Win32::GUI and Perl and > operating system you're using. > > > cheers, > Aldo > > __END__ > $_=q,just perl,,s, , another ,,s,$, hacker,,print; > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |