Hi, Patrick and Sundar!

I have had a comparable problem with a Change event in a rich text field.
After a few hours of experimentation and a peek at Aldo's examples and at
some Win32 API documentation, I found that I had to send a 1093 message to
the widget before using the callback, like this:

        $RichTextField->SendMessage(1093, 0, 1);

I don't know whether 1093 will work for listboxes, though. Perhaps those
need another "magic number"?.

I would say it IS a bug in win32::gui that the message hasn't been
"pre-sent", so to say.

- Baldur Kristinsson


At 19:24 21-04-99 , you wrote:
>
>
>hmmm.  never thought about this one, since i did not need to use it this way.
>but i just checked delphi to see if this is the "standard" way that listboxes
>are supposed to function - ie, a click event initiates a callback.  and it 
>does.
>so, is this a bug in win32::gui?
>
>
>
>
>Patrick RENAUD <[EMAIL PROTECTED]> on 04/21/99 08:38:30 AM
>
>Please respond to [EMAIL PROTECTED]
>
>To:   [EMAIL PROTECTED]
>cc:    (Sundar Raman/MW/US/3Com)
>Subject:  [perl-win32-gui] ListBox click event and scrollbars
>
>
>
>
>Hi folks,
>
>I declare a ListBox with single selection and want to catch the click
>event when the user select an item but nothing appears when I click on
>an item of the box : the callback is not executed.
>
>Does anybody try using this callback ? Is it a special declaration of
>the listbox ?
>
>An other problem is that I declare the ListBox with vertical and
>horizontal scrollbars and only vertical scrollbar is displayed.
>
>My code is :
>
>     $mainWin->AddListbox(
>           -name => "listBox",
>           -left => 20,
>           -top => 20,
>           -width => 200,
>           -height => 220,
>           -style  => WS_VISIBLE | WS_VSCROLL | WS_HSCROLL,
>     );
>
>     sub listBox_Click {
>           print "selected item =
>          ".$mainWin->listBox->SelectedItem()."\n";
>           print "selected text =
>
>".$mainWin->listBox->GetString($mainWin->listBox->SelectedItem())."\n";
>     }
>
>I tried also with the DblClick event : same result (nothing is done).
>
>Thanks for the help.
>--
>   _____________________________________
> /                                       \
>|           Patrick RENAUD                |
>|                                         |
>|   [EMAIL PROTECTED]   |
> \_______________________________________/
>


Reply via email to