textChanged is not invoked after cutting text

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

textChanged is not invoked after cutting text

Post by kaveh1000 » Sat Jan 19, 2019 10:27 am

Working on Mac with latest Community version of LC. Cutting text via menu or keyboard shortcut does not invoke textChanged handler. (But pasting does.) Please see attached minimal example.
Attachments
textChanged.zip
(928 Bytes) Downloaded 211 times
Kaveh

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod » Sat Jan 19, 2019 11:32 am

Hi,
Same result fro me (lC indy 9.0.1)
It works with a simple "cut" message sent by a btn

Code: Select all

on mouseup
   cut
end mouseup
I wonder if that is an IDE behavior
What happens in standalone ?
https://alternatic.ch

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs » Sat Jan 19, 2019 11:58 am

Tested using ctrl + x on Win7 with Lc 9.0.2, and it doesn't count as a text changed event there, either. It *does* however on 'nix using Lc 6.x, so I'm guessing it is a bug?
Win7Tester [Running] - Oracle VM VirtualBox_004.png
One...
Win7Tester [Running] - Oracle VM VirtualBox_005.png
twooo...
Win7Tester [Running] - Oracle VM VirtualBox_006.png
threeeeee! (Count the smilies)
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: textChanged is not invoked after cutting text

Post by richmond62 » Sat Jan 19, 2019 1:03 pm

Hmm . . .
-
TextCH.png
Attachments
Text Change.livecode.zip
Here's the stack.
(1020 Bytes) Downloaded 207 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: textChanged is not invoked after cutting text

Post by richmond62 » Sat Jan 19, 2019 1:07 pm

I wonder why this does NOT seem to work:

Code: Select all

if the clipBoardData is not empty then
      put "CRAP"
   end if
when I've CUT some text?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: textChanged is not invoked after cutting text

Post by richmond62 » Sat Jan 19, 2019 5:56 pm

Cut

does not behave in the same way as delete
because delete involves an insertion point in a field
while cut involves selectedText.

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: textChanged is not invoked after cutting text

Post by kaveh1000 » Tue Jan 22, 2019 10:35 am

Hi folks

Just an update that I have reported this and it has been confirmed as a regression bug:

https://quality.livecode.com/show_bug.cgi?id=21802

Thanks for your comments on this.

Kaveh
Kaveh

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs » Tue Jan 22, 2019 12:02 pm

Good job on that Kaveh, we got to keep Panos hammer swinging on those bugs Image
Image

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod » Tue Jan 22, 2019 12:17 pm

Hi All,
It seems that only concern IDE.
I played with an edit menu created with menu builder and it send a textchanged message on idE or standalone and shortcuts work as expected in standalone (LC 9.0.1 OSX 10.139
textChange001.zip
(1.93 KiB) Downloaded 214 times
Best
Jean-Marc
https://alternatic.ch

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs » Tue Jan 22, 2019 1:19 pm

That is good to know Jean-Marc, of course, from our perspective (devs) it is important to work everywhere eh :)
Image

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: textChanged is not invoked after cutting text

Post by kaveh1000 » Wed Feb 06, 2019 1:13 pm

Hi Folks

So cutting text will invoked in Standalone but not in IDE due to a bug. Is there any handler I can use in the meantime to detect when text has been cut?

Regards
Kaveh
Kaveh

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: textChanged is not invoked after cutting text

Post by bogs » Wed Feb 06, 2019 1:21 pm

I would suspect you could use the clipboard, since we are talking about cutting/copying operations. One way might be to throw the clipboard contents into a variable, then check if the text in the variable changes.
Image

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: textChanged is not invoked after cutting text

Post by jmburnod » Mon Feb 11, 2019 5:07 pm

Hi All
Textchanged also doesn’t work when I put a letter by script into/after/before a field
Jean-Marc
https://alternatic.ch

Post Reply

Return to “Talking LiveCode”