Thanks for the info. Unfortunately most of the code samples posted at the Win32::GUI Documentation project web site at jeb.ca (a very helpful web site) use $Window->Dialog() instead of the correct form Win32::GUI::Dialog(). Another example code previously posted on this mailing list using a Combobox w/ droplist also called $Window->Dialog() ... the droplist didn't work with the mouse but it wasn't obvious why. I wonder if invoking Dialog() via an instance should be outright forbidden in GUI.pm or GUI.xs.

-Kurt




From the html page for the Win32::GUI class:

> Dialog()
>
> Enter the GUI dialog phase: the script halts, the user can interact with the created > windows and events subroutines are triggered as necessary; note that this function > must be called without ANY parameter or instantiation (eg. don't call it as method
> of a created object):
>
> Win32::GUI::Dialog();   # correct
> $Window->Dialog();    # !!!WRONG!!!
>
> Win32::GUI::Dialog(); does a similar thing to while(Win32::GUI::DoEvents() != -1) {};
>
> see also DoEvents() see also DoModal()

Regards,
Rob.


Kurt G wrote:

From reading this list it seems I'm wasn't the only Win32::GUI user

befuddled by droplist style Combobox control not catching mouse clicks and other events. I spent way too much time yesterday RTFM, digging for a solution, and trying to get it to work but finally today stumbled into the solution:

If you create a Window and Combobox control like so:

  $Window = new Win32::GUI::Window( ... options ... );

  $Window->AddCombobox( ... options .... );

...and if your main window is processing messages like so:

  $Window->Dialog();

...then it seems that not all messages (such as mouse clicks) are filtered down to the Combobox control (thus not allowing droplist items to be selected with mouse clicks) unless you change the above statement to this:

   GUI::Dialog();

...or I suppose Win32::GUI::Dialog() would work just the same, and presto, now you can mouse click on items in the Combobox droplist. Seems to affect which messages are being passed down to the Combobox control via its parent window.

I don't know if this is a Win32::GUI::Combobox bug or what but anyhow hope this hint is useful to other users running into similar issues.

-Kurt






Reply via email to