in reply to Re: Win32:GUI Combo Boxes
in thread Win32:GUI Combo Boxes

Thanks for your suggestion. It might be better if you get a full look at my code.
use Win32::GUI(); $main = Win32::GUI::Window->new( -name => 'Main', -width => 500, -height => 500, -text => 'Auto Log', ); $main->AddCombobox( -name => "combo_box", -width => 120, -height => 110, #-tabstop=> 1, -pos => [5,160], -dropdownlist=> 0, ); my $combo_box = $main->AddComboBox( $combo_box->InsertItem( "One" ), $combo_box->InsertItem( "Two" ), $combo_box->InsertItem( "Buckle my shoe" ), ); $main->Show(); Win32::GUI::Dialog(); sub Main_Terminate { -1; }
Now with code you supplied, now I get this error. "Can't call method "InsertItem", on a undefined value"

Replies are listed 'Best First'.
Re^3: Win32:GUI Combo Boxes
by Narveson (Chaplain) on Aug 31, 2009 at 17:55 UTC

    Paste the code I supplied over the version you typed.

    Then you will have to replace my ellipsis (...) in the AddComboBox call with the proper argument list (try the one you supplied to your first AddCombobox call).

    Please pay attention to punctuation. To a programmer, there is all the difference in the world between a comma and a semicolon.

Re^3: Win32:GUI Combo Boxes
by Karger78 (Beadle) on Aug 31, 2009 at 17:45 UTC
    Hello, Thanks for your answers. After looking at it a bit better. Here is what I added to make it work correctly.
    $main->AddCombobox( -name => "combo_box1", -width => 120, -height => 110, #-tabstop=> 1, -pos => [5,160], -dropdownlist=> 0, ); $main->combo_box1->InsertItem("One");
    Thanks once again for your help.