David,
 
Here is an example:
use Win32::GUI;
 
my $screen_width = Win32::GUI::GetSystemMetrics(0);   ## gets current screen width
my $screen_height = Win32::GUI::GetSystemMetrics(1);   ## gets screen height 
my $minwidth = 600;   ## width I want the window to start at
my $minheight = 240;   ## height I want the window to start at
$DataWindow = new Win32::GUI::Window(
 -name   => "DataWindow",
 -top    => ($screen_height - $minheight)/2,   ## center window vertically 
 -left   => ($screen_width - $minwidth)/2,   ## center window horizontally
 -width  => $minwidth,
 -height => $minheight,
 -title  => "Fruit Chooser",
);
 
$DataWindow->AddLabel(
 -name   => "Combo_Label",
 -text   => "Fruit: ",
 -top    => 55,
 -left   => 25,
 -visible=> 0,
);
 
$FruitList = $DataWindow->AddCombobox(
 -name   => "Dropdown",
 -top    => 52,
 -left   => 90,
 -width  => 120,
 -height => 110,
 -tabstop=> 1,
 -style  => WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP,
);
 
$FruitList ->InsertItem("apple");
$FruitList ->InsertItem("banana");
$FruitList ->InsertItem("cantaloupe");
$FruitList ->InsertItem("grapes");
$FruitList ->InsertItem("orange");
$FruitList ->InsertItem("pear");
$FruitList ->InsertItem("star fruit");
 
sub Dropdown_Change {
    $FruitList->Text($FruitList->GetString($FruitList->SelectedItem));
}
 
 
 
Jonathan
--------------------------------------------------------------
Jonathan Southwick                              [EMAIL PROTECTED]
Technical and Network Services
Allegheny College
Meadville, PA  16335                             814-332-2755
 
 
----- Original Message -----
From: Kuo David
Sent: Wednesday, September 27, 2000 10:35 AM
Subject: [perl-win32-gui]

Hi there,
 
Can any one tell me how to make the combobox showing the item list when user click it by the mouse. The comboxbox I made does not allow me to select item by mouse. I have to use up/down arrow to do that. Thanks in advance.
 

Feng-Shen (David) Kuo
Senior Scientific Programmer
Orchid BioSciences, Inc.
Princeton NJ  08540

Reply via email to