Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Win32::GUI::Richedit strange results for deselecting a selection (events)

by Anonymous Monk
on Feb 07, 2013 at 08:56 UTC ( #1017597=note: print w/ replies, xml ) Need Help??


in reply to Win32::GUI::Richedit strange results for deselecting a selection

within the selection: although the text ist deselected, querying the control still returns the values of the old selection, which is NOT OK!

I see that too, but it doesn't seem to strange to me, since your mouse handler (callback) is being called before the selection change is registered, before the selection range is updated, before the selchange event is generated

You should be binding to a "SelChange" event , but you can't
Rich Edit (Windows)
EN_SELCHANGE notification code (Windows)
I would use Wx


Comment on Re: Win32::GUI::Richedit strange results for deselecting a selection (events)
Re^2: Win32::GUI::Richedit strange results for deselecting a selection (events)
by tomsell (Acolyte) on Apr 08, 2013 at 20:14 UTC

    (just now came across my post through a Google search, ... here's the solution for completeness sake)

    "SelChange" event: quite right! That's what hooks are for.

    $myRichEdit->Hook(EN_SELCHANGE, \&SelChangeEvents_Handler); sub SelChangeEvents_Handler { my ($object, $wParam, $lParam, $type, $msgcode) = @_; return unless($type == WM_NOTIFY); return unless($msgcode == EN_SELCHANGE); my ($hwndFrom, $idFrom, $code, $cpMin, $cpMax, $seltyp) = unpack("LLLLLL", unpack("P24", pack("L", $lParam))); return unless($hwndFrom == $object->{-handle}); my $haveSelection = ($cpMin != $cpMax); if($haveSelection){ print STDERR " we have a selection!"; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1017597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-08-30 02:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls