From: pcourterelle <pco...@te...> - 2007-07-04 09:06:32
|
Rob, thanks for that...that drove me nuts for a while...what does SetTopIndex() do if it does ensure the value of the index is visible in the Listbox? The info says: SetTopIndex SetTopIndex(INDEX) Ensure that a particular item is visible in the Listbox of a Combobox. Just curious. Thanks phil ----- Original Message ----- From: "Robert May" <rob...@us...> To: "Jacques Choquette XX (QB/EMC)" <jac...@er...> Cc: <per...@li...> Sent: Thursday, June 28, 2007 3:04 PM Subject: Re: [perl-win32-gui-users] combobox > On 28/06/07, Jacques Choquette XX (QB/EMC) > <jac...@er...> wrote: >> I am trying to see the first item in the list that I have built for a >> combobox. When I run the script, the combobox is there but I cannot >> see the item like 'info'. What am I doing wrong? I am using Perl 5.8 on >> Windows 2000 >> >> $Window->AddCombobox( >> -name => "CB", >> -dropdown => 1, >> -left => 50, >> -top => 100, >> -height => 80, >> -width => 80, >> -hasstring => 1, >> -onChange => \&GetInfoCB, >> -tabstop => 1, >> # -uppercase => 1, >> # -sort => 1, >> ); >> $Window->CB->Add('none', 'info', 'warning', 'error'); >> $Window->CB->SetTopIndex('1'); >> $Window->CB->TopIndex('1'); >> $Window->CB->FirstVisibleItem('1'); > > Try this. > > > #!perl -w > use strict; > use warnings; > > use Win32::GUI qw(CW_USEDEFAULT); > > my $mw = Win32::GUI::Window->new( > -left => CW_USEDEFAULT, > -size => [400,300], > ); > > $mw->AddCombobox( > -name => "CB", > -dropdown => 1, > -left => 50, > -top => 100, > -height => 80, > -width => 80, > ); > $mw->CB->Add('none', 'info', 'warning', 'error'); > $mw->CB->SetCurSel(0); > > $mw->Show(); > Win32::GUI::Dialog(); > $mw->Hide(); > exit(0); > __END__ > > Regards, > Rob. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |