IDE does not accept pasted methods?!

As I’m still using the old Real Studio IDE for editing my projects, because I’m sure the new IDE is still lacking many abilities that the old one had, I’m keeping running into issues I’d thought should have long been solved. Here’s another one I just found:

I used to be able to copy examples, e.g. from http://documentation.xojo.com/index.php/Declare, and paste them into a project. For example, if I copy the “Function doubleClickIntervalInSeconds … End Function” and paste it into a class in the old IDE, it adds it as a method just as expected. The new IDE, however, doesn’t.

Am I the first to notice this?

Also, when I use the context menu on a “Methods” folder in the new IDE and choose Paste, it doesn’t do anything, not even beep. But the Paste command in the Edit menu is disabled. So, the one in the context menu should be disabled as well.

Yes, these are known. You also can’t copy a declare from the navigator and paste it into the source code editor anymore (actually you can paste it, but half of the declare is missing). There are more things not working than with last years version of Xojo. It’s really annoying. Frankly, I don’t understand what thy are doing – why does any improvement of the navigator result in half a dozen of disimprovements?

yes it is annoying…
if you select first a method, by clicking twice on it to make it blue colored (not grey)
then you can paste a method you copied elsewhere it works.

And another thing: I am debugging, using “Open in New Window” on an object in the Variables pane. The new window shows no rows. But when I instead click on the object and let it show within the Variables pane, then I see the rows as expected. WTF?

I’ve noticed that copy/paste doesn’t work when I try to duplicate something (why no duplicate command?) but an Option-Drag (on Mac) works fine. Try dragging.

Copy & paste of the text of a method works
I’ve just copied all the methods from the page Thomas pointed to and pasted them into the IDE

  1. start new desktop project
  2. go to web page
  3. copy full text of method (from function through to end function)
  4. right click on the Window1 object in the project
  5. select paste from the contextual menu (or from the menu or whatever)
    the method gets pasted every time here

And duplicate is on the same contextual menu

IF you find this isn’t working please record a video showing it failing & attach to a bug report
Why a video ?
This almost always shows us some thing that is not listed when steps are written out

It does not work with the current version (on OS X El Capitan).

Hi Norman,

I wasn’t referring to copying text, I was referring to selecting an object in the navigator sidebar and trying to duplicate it.

Works fine here from 10.9 through 10.12 (I’ve just tried it on all 4 several times without failure and am on 10.12 as I write this)
Thats why I asked [quote=291514:@Norman Palardy]
IF you find this isn’t working please record a video showing it failing & attach to a bug report
Why a video ?
This almost always shows us some thing that is not listed when steps are written out[/quote]
Otherwise its just anecdotes that I cannot fix or do anything about

[quote=291516:@Art Gorski]
I wasn’t referring to copying text, I was referring to selecting an object in the navigator sidebar and trying to duplicate it.[/quote]
Me too
I use that all the time

A video is not necessary (and I also don’t have any software to do it anyway). The fact is:

  • Paste is enabled in the Edit menu and in the contextual menu of the navigator.
  • Pasting to TextEdit shows: declare sub addSubview lib “Cocoa” selector “addSubview:” ( NSView as integer, subview as integer )
  • Nothing happens when pasting into the navigator, not when an element (App, class, module) is marked blue, not when it is marked only grey. It doesn’t matter if its Menu–>Edit–>Paste, Cmd-V, or the contextual menu.

It did work a some versions ago and I think – like with copying declares from the navigator to the source code editor – it stopped working when this (rather stupid) change was made to the contextual menu of the navigator dimming all entries but one. Whoever had this idea… Open a class in a new tab: you now only can enter new elements of a type where at least one already exists as you can not select the class itself. So if you have a class with some methods, you open it in a new tab, you can only add new methods, but no properties, no constants, no whatsoever. Unless you chose to show the entire project tree, which of course is not what one wants when choosing to open a class or module in a tab. Why is the class or module not the root of such a tab?

[quote=291528:@Eli Ott]A video is not necessary (and I also don’t have any software to do it anyway). The fact is:

  • Paste is enabled in the Edit menu and in the contextual menu of the navigator.
  • Pasting to TextEdit shows: declare sub addSubview lib “Cocoa” selector “addSubview:” ( NSView as integer, subview as integer )
  • Nothing happens when pasting into the navigator, not when an element (App, class, module) is marked blue, not when it is marked only grey. It doesn’t matter if its Menu–>Edit–>Paste, Cmd-V, or the contextual menu.
    [/quote]
    This isn’t a bug
    I have no idea what you’d expect it to paste but it does nothing in 2012r2.1 either (just FYI)
    In 2015r4.1 while PASTE is enabled (incorrectly) pasting does nothing

Isn’t that called a contradiction?

I have not had a problem with this, but then I’m on Windows (a superior product :))

In 2016R3, pasting a method from text (ie the forum) works just fine on Mac.

I tested this after the initial post and had the problem, couldn’t paste a function copied from TextEdit.

Now Michel mentions it works from the forum and testing that it does work. huh? Testing TextEdit again it works there too!? So I read over this thread more carefully and notice point 4 from Norman

You have to select the object to paste into.

When it wasn’t working I was selecting a method in the methods section I wanted to paste into.
This technique doesn’t work with a method copied from text but it does work when the method was copied within the IDE. Since this is usually how I move methods around in the IDE I’d initially only tested my habit and thought Thomas was right.

It seems there’s just a slightly different rule for pasting copied text vs pasting something copied from the navigator.

I paste to a module, window or ContainerControl, or custom control. Not to a method. Would not seem logical.

Also works in Linux (in 2016R3, unfortunately not in version 2015R1)

If you’re looking at just the class opened in a tab then there’s no root/object widget to select and paste into, only the method section, properties section, etc, are available.

You’d have to switch to the full navigator view and find the class to finally select and paste.

Ah, I see the arrows at the top of the navigator make it easy to switch from just the class in a tab to that class expanded in the full project view, and back.

Alright - here’s what I did “wrong”: I had the “Methods” selected in the left pane. When I do that, or when I right-click on “Methods”, and try to paste a copyied function from text, pasting does NOT work. Can others confirm this? And does everyone agree that this should work, i.e. adding another method to the list of Methods should work?