I think I got it !

For anyone else who may ever encounter this, here's what I got:

the -size argument for the combobox controls the size of the combobox once
you've clicked on its arrow.
I increased that to something more than 20 to see the items.

Also, I used the Select method on the combobox before the Dialog() call
to make sure the first item would be selected.
As far as ther combobox styles, here's what seems to work (so far) for me:
-addstyle     => WS_VISIBLE | 2  | WS_VSCROLL

Thanks everyone for reading,
and feel free to send any more suggestions you may have,

F.O.R.



Date: Wed, 22 Sep 2004 08:07:42 -0400
To: perl-win32-gui-users@lists.sourceforge.net
From: Francesco Rizzi <[EMAIL PROTECTED]>
Subject: Combobox shows up empty !

Argh !

I'm using the CPAN Win32::GUI package (v.0.0.558).
I'm trying to use a combobox in one of my windows.
Right now, I've reduced the problem to the sniplet below,
and I'm using the
-style     => WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP
option when creating the combobox as I've found it in a couple
of threads on the net.

What am I doing wrong?
The combobox shows up with no items in it.

[code]
#!/usr/bin/perl

use Win32;
use Win32::GUI;

use strict;
use warnings;

my $mainWindow;

my $scheduleUpdateDialog;
my $ddmUpdateTimes;

my @availableTimes = ("1:00", "13:00");

MAIN:
   $mainWindow = new Win32::GUI::Window(
                                       -text => "Test",
                                       -name => "MainWindow",
                                       -pos  => [ 200, 400 ],
                                       -size => [ 400, 300 ]
                                       )
      or die("Could not initialize main window: $!");
   $ddmUpdateTimes = new Win32::GUI::Combobox(
                                             $mainWindow,
                                             -name    => "ddmUpdateTimes",
                                             -pos     => [10, 10],
                                             -size    => [290, 20],
-style => WS_VISIBLE | 3 | WS_VSCROLL | WS_TABSTOP
                                             )
      or die("Could not initialize Schedule Updates Dialog (Combobox): $!");
   $ddmUpdateTimes->Clear();
   $ddmUpdateTimes->Add("[no-updates]");
   foreach my $time (@availableTimes)
      {
      $ddmUpdateTimes->Add($time);
      }

   $mainWindow->Show();
   my $exitCode = Win32::GUI::Dialog();
   print STDERR "Exiting with code '$exitCode'.";
   exit(0);


sub MainWindow_Terminate
   {
   return -1;
   }

[/code]

Thanks in advance,
F.O.R.


Reply via email to