How do I access sub source code?

With the old REALbasic, somehow I was able to get to the point where I had a list of subs in the left-hand column. If I clicked on one of them, I saw the source code for that sub to the right, ready for editing. Both user-defined subs/functions and subs/functions for control events (e.g., action) were included in the list at the left.

With the new Xojo, what are the steps involved in similarly accessing source code for subs to be edited?

Thanks for the help.

Barry Traver

With the old REALbasic, somehow I was able to get to the point where I had a list of subs in the left-hand column. If I clicked on one of them, I saw the source code for that sub to the right, ready for editing. Both user-defined subs/functions and subs/functions for control events (e.g., action) were included in the list at the left.

With the new Xojo, what are the steps involved in similarly accessing source code for subs to be edited?

Thanks for the help.

Barry Traver

This is in Xojo 100% the same. You only need to add events yourself.

Beatrix,

“You only need to add events yourself.” What does that mean? I’ve spent the last two and a half hours trying to log in and trying to access subs and functions and I’ve done a lot of clicking on various items on the left side without productive response. To me at least, Xojo is NOT “100% the same” unless I can get to the point where I can see subs and functions on the left of the screen and source code to the right of that.

People who learn easily may not easily understand how what is obvious to them is not obvious to those who do not learn as easily.
Let me say that I do appreciate your taking the time to post a response to my query (thus far you’re the only person to do that), but I am a slow learner who needs more detailed help.

Many people consider Xojo to be better than REALbasic, but you can’t be better without being different (i.e., NOT “100% the same”). So thank you for responding and thank you for your patience with a person like me who needs significant help in seeing what may be obvious to others.

Barry Traver

Hi Barry
One of the biggest changes from Real Studio to Xojo is that Event Handlers (subs) are no longer added by default - when adding a PushButton, Real Studio used to show all the events that a PushButton could receive. In an attempt to have less items in the Navigator (the listbox to the left), Xojo doesn’t add all the events automatically - but it’s easy to add the ones you want.

For example, drag a PushButton onto a window in a new project. You’ll see PushButton1 on the left hand side, listed hierarchically underneath Window1. There’s a few ways to get your Event Handlers back - you could just double-click the PushButton in the Layout Editor (the large area in the middle). A window will drop down which will allow you to select which Events you want your control to handle. With a PushButton, you’ll probably want to add the Action handler.

Another way to add Event Handlers is to select the control in the Navigator on the left and then click the large blue “Insert” button on the very left hand side of the toolbar. From there, select Event Handler.

You could even right click on the control in the Navigator and select Add to PushButton1, then Event Handler. Bonus marks if you use the keyboard shortcut :wink:

Whatever method you use, the Navigator will now show that Window1 contains a PushButton1 which contains an Action event. Click Action and you’re back inside your Event Handler/sub.

The Upgrade Guide is worth a read - Section 4 will be relevant to you. The Upgrade Guide can be found in Xojo’s Help menu.

Hope that helps a little.

Gavin,

That helps a lot! Thank you, thank you, thank you!

Do you have any advice on the easiest way to log in? RIght now I’m using a Xojo generated password (I couldn’t figure out how to define my own password) and Xojo doesn’t seem to allow use of “Copy” and “Paste” (which I tried to use to avoid any typo’s), but it’s extremely difficult for me to type three dozen characters without making a mistake (I have Parkinson’s Disease, which means in my case that it is rare for me to type a line without making at least one mistake). And one mistake is a killer when logging in.

I definitely will take a look at the Xojo Upgrade Guide that you mentioned. I evidently missed noticing its addition to the Help menu, but it will probably help me with other questions that I have about Xojo (such as how go use “Find,” which does nothing after I choose it on the Edit menu).

Thanks again for the help.

Warm regards,

Barry Traver

Go to https://xojo.com/account/settings/
If you aren’t signed in, you’ll have to sign in I’m afraid, so you’ll need to get the Xojo generated password entered correctly once. However, after that, you can change your password on the next screen. There are three textfields near the top left - the first one is your username but the next two are for your new password (it’s got to be 8 chars or more). Enter the new (simpler) password twice and then hit the blue Save button at the bottom (don’t hit the Generate Secure Password button).

If you still can’t get logged in, you could try asking if Xojo Inc would change the password for you, no idea if they can do this for you - https://xojo.com/company/ has their contact details.

Edit>Find should reveal a Find window at the bottom of Xojo’s interface - but yes, the Upgrade Guide should help you. One more thing that might help, check out Paul’s archived Webinar videos at https://xojo.com/support/webinar.php - there’s a session called Introduction to Xojo (haven’t watched it myself).