Apparently something has changed with the textfield in Xojo 2018r2. Just dragging a textField from the Library onto my app, then running the app, I am unable to Paste (cmd-V) to that textField. I get a system beep if I try. What do I need to do to the generic textField to allow it to receive Paste? I’ve never had to do anything in previous versions.
Can you reproduce this in a new project?
cmd-V so I guess this is on a mac, right?
Open finder, go to Edit - Show Clipboard and check what you have there.
The only way I can make it beep is when the clipboard contents is a graphic and not text. If the clipboard say text (even if empty) it will not beep, at least for me.
Tim: No. I had tried several new TextFields to my window in question and all had this odd behavior. But a new project and other projects does not. I think something is corrupted with my window. Might be explaining other odd behavior I am seeing.
Alberto: I have iClip installed so I can see many clips and know for sure what I am trying to paste.
Thanks both for your replies.
Check that there’s a menu bar on the window and that it has an Edit > Paste item with a shortcut of Cmd-V
No, there’s no menubar attached to this movable modal window, but that doesn’t matter. All of my other apps have no menu attached to this registration window and they accept cmd-V just fine
Thats not my experience.
Pasting into a text box on a movable modal without a menu hasnt worked for me for years.
I put this code into the KeyDown event of the text box
[code]dim c as new Clipboard
if key = " " then return false
if (key = “v” or key = “V” )and Keyboard.AsyncMenuShortcutKey and c.TextAvailable then
me.Text = trim(C.Text)
end if[/code]
I am totally confused. I have 4 apps on the MAS and 4 apps actively selling from my web site. I have NEVER, repeat Never had to add code to the keydown event of a textfield to get copy and/or paste to work. (Yes, I just checked) That’s whether there’s a menu attached to the window or not. :-0
I am confused too and I don’t understand.
I did some tests, small project, 2 windows, window2 movable modal, menu bar none, with textfield. I can always use cmd-v to paste there.
The only way to stop cmd-v from working is to EditPaste.Visible = False before showing window2 or if I remove the entry from MainMenuBar, but also stops working on window1.
I guess I’m missing something.
Hmm… maybe…is there a menu attached to any of your currently open windows?
Does it still work if your ONLY open window is a movable modal with no menu?
Don’t forget the Mac paradigm for menus means you likely have one, even if you didn’t set one. On Mac everything shares one MenuBar
. If you don’t assign a MenuBar
to a window, it still uses a MenuBar
from somewhere.
Only thing we can say at this point is post the project, because nobody else can reproduce the behavior.
That must have been the behavior I was seeing all along without realizing it. Thanks for the informative discussion on this topic, Tim, Jeff, and Alberto.