Cut the selectedChunk
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Cut the selectedChunk
Hi! I am missing something simple.
I have "put the selectedChunk into gVariable" in an unlocked field for a mouse click which pops up a menu button.
In the menu button pick handler I put "cut gVariable". Obviously I declare gVariable in both handlers. (I cannot simply use "cut" because the field loses focus when the menu pops up).
gVariable contains "char 178 to 191 of field 1" - the field number rather than it's name.
When executed it cuts the entire field object, not the selection.
What am I missing? It's got to be something really simple, I'm just brain dead and can't find it.
Thanks, Walt
I have "put the selectedChunk into gVariable" in an unlocked field for a mouse click which pops up a menu button.
In the menu button pick handler I put "cut gVariable". Obviously I declare gVariable in both handlers. (I cannot simply use "cut" because the field loses focus when the menu pops up).
gVariable contains "char 178 to 191 of field 1" - the field number rather than it's name.
When executed it cuts the entire field object, not the selection.
What am I missing? It's got to be something really simple, I'm just brain dead and can't find it.
Thanks, Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Cut the selectedChunk
I wonder if this is related to bug report 7766?
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Cut the selectedChunk
Odd, indeed. How could this have gone unnoticed?
Just so you know, this works:
I will have to see if HC exhibits the same...
Craig Newman
Just so you know, this works:
Code: Select all
on mouseup
put the selectedChunk into temp
do "cut" && temp
end mouseUp
Craig Newman
Re: Cut the selectedChunk
Now this thing is intermiitant. I made a few fields, ran the code in several ways:
on mouseup --this never fails
cut the selectedChunk
end mouseUp
on mouseup -- this is intermiittant, field disappeared several times, but not always
put the selectedChunk into temp
cut temp
end mouseUp
on mouseup --this never fails
put the selectedChunk into temp
do "cut" && temp
end mouseUp
But now I cannot duplicate the bug at all. Everything works fine. ("I got better...") I will try a new session.
Ah. It turns out that closing and reopening a stack will cause this to happen once. Once the bug occurs, and a field is deleted, then all subsequent runs work just fine, even with new fields. I am sure we can all write scripts on preOpenStack to create a field, lose it, and then leave everything just ducky.
Craig Newman
on mouseup --this never fails
cut the selectedChunk
end mouseUp
on mouseup -- this is intermiittant, field disappeared several times, but not always
put the selectedChunk into temp
cut temp
end mouseUp
on mouseup --this never fails
put the selectedChunk into temp
do "cut" && temp
end mouseUp
But now I cannot duplicate the bug at all. Everything works fine. ("I got better...") I will try a new session.
Ah. It turns out that closing and reopening a stack will cause this to happen once. Once the bug occurs, and a field is deleted, then all subsequent runs work just fine, even with new fields. I am sure we can all write scripts on preOpenStack to create a field, lose it, and then leave everything just ducky.
Craig Newman
Re: Cut the selectedChunk
Craig,
The issue I had also involved a popup menu (where the "cut" is executed), and I think that changes focus, and mangles something somewhere. I can also cut from within a field's script, it's the popup which seems to mess things up.
Walt
The issue I had also involved a popup menu (where the "cut" is executed), and I think that changes focus, and mangles something somewhere. I can also cut from within a field's script, it's the popup which seems to mess things up.
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Cut the selectedChunk
Walt.
I put in a bug report. The way I do it is reproducable. And really odd.
# 9778.
Craig
I put in a bug report. The way I do it is reproducable. And really odd.
# 9778.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
Re: Cut the selectedChunk
Hi Walt, I can confirm "do "cut" && gvariable" works in a popup on both Mac's and PC's. No evidence of 7766 there. I'm posting my test program.WaltBrown wrote:Craig,
The issue I had also involved a popup menu (where the "cut" is executed), and I think that changes focus, and mangles something somewhere. I can also cut from within a field's script, it's the popup which seems to mess things up.
Walt
-- Mark
PS the "cut" script is in Choice 1 on the popup
- Attachments
-
- test1.livecode.zip
- test of cutting text in a field with a popup choice
- (1.08 KiB) Downloaded 257 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
Re: Cut the selectedChunk
Thanks. I guess "cut" will remain buggy if called directly. I'll remember to use the 'do "cut"' instead.
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Cut the selectedChunk
The bug is confirmed by QCC. Still hard to believe this was never noticed.
I still intend to check HC, but I don't expect to find it there.
Craig Newman
I still intend to check HC, but I don't expect to find it there.
Craig Newman