| Click here to select a new forum. |
| Programming with ReadBASIC |
Posted by: VMSZealot on 2023-03-27 10:44:52 I thought I'd take a break from the day job of hacking with C, and play with ReadBASIC on the Mac. It seems VERY limited - but perhaps that's me (probably is). How do I, for example, create an application which doesn't have a window? It seems like it should be possible (because in Project Settings I can select <None>), but I can only open the code editor if I have a Window to edit code for. I can't, for example, seem to have a class for the menu items (which is what I'd like).
I'd like to be able to have an application load with just a menu bar, and to have Preferences under the Edit menu and then to be able to select Preferences from Edit and have it load the Preferences window at that point.
I'd also like it to be able to do stuff when it loads, when it quits, and every few minutes - all without a menu on the screen.
To further complicate matters, I chose RealBASIC 1.1 from MacintoshGarden in order to have the compiled code run on the widest variety of Macs. |
Posted by: Phipli on 2023-03-27 11:18:12 Not answering your question at all, but I suggest grabbing a newer version than 1.1. Version 2 has similar target platform requirements, but is better in every way. |
Posted by: Phipli on 2023-03-27 11:20:24 WRT your actual question, there is a way, but it isn't part of RealBasic, I'd have to do some testing. It isn't really what that age of RealBasic is for.
Basically there is a flag that can be used to set an application as a background application, but it crashes if you do certain things.
The other option is hide the window on launch. |
Posted by: VMSZealot on 2023-03-27 12:33:40
WRT your actual question, there is a way, but it isn't part of RealBasic, I'd have to do some testing. It isn't really what that age of RealBasic is for.
Basically there is a flag that can be used to set an application as a background application, but it crashes if you do certain things.
The other option is hide the window on launch. I tried hiding the window `.visible = false` - but then no methods run on that window either. |
Posted by: Phipli on 2023-03-27 13:29:22
I tried hiding the window `.visible = false` - but then no methods run on that window either. This is is an application with no default window:
View attachment 20230327_212459_1.mp4
Created like this in RB 2.1.2 :
View attachment 20230327_212144_1.mp4 |
Posted by: Phipli on 2023-03-27 13:39:14 To make it have no menu bar or UI at all, you do this (this is three quacks without the quit command) :
View attachment 20230327_213111_1.mp4 |
Posted by: Phipli on 2023-03-27 13:55:21 One last trick, once you have the program set to run in the background like above, you can turn it into a special type of extension that launches when the user gets to the desktop. You just change the file type from "APPL" to "appe", then drop it in the Extensions folder.
Changing the existing background app into an extension application :
View attachment 20230327_214737_1.mp4
Showing it working:
View attachment 20230327_215056_1.mp4
It quacks three times when the computer finishes booting and the extension executes, then it continues running invisibility in the background, wasting RAM 🤣 |
Posted by: aladds on 2023-03-27 14:02:53 I can confirm that the method you use (changing the default window in project settings and adding a class with Super set to Application) works in Realbasic 1.1. That said there are quite a few bugs in 1.1 from memory, so I'd try to use at least 2.1.2 as has been suggested already 🙂 |
Posted by: Phipli on 2023-03-27 14:23:52
I'd also like it to be able to do stuff when it loads, when it quits, and every few minutes - all without a menu on the screen. To be honest, I'd have the background stuff done by one app that just ran invisibly in the background as an "appe", and create another that communicates with the first via apple events and saves settings as a preference file, to provide the UI for setup. In the style of a Control Panel. |
Posted by: Phipli on 2023-03-27 14:32:12
I can confirm that the method you use (changing the default window in project settings and adding a class with Super set to Application) works in Realbasic 1.1. That said there are quite a few bugs in 1.1 from memory, so I'd try to use at least 2.1.2 as has been suggested already 🙂 Yeah, I don't have 1.1 installed, it didn't feel like a mature product until version 2. |
Posted by: aladds on 2023-03-27 14:36:18 I was sad when I started using RealBASIC since I'd been playing with demos of 2.1 and 3.5, but then when I bought my license (and I still have the original paperwork somewhere) I could only get 5.2...which couldn't make 68k apps! 🙁
These days the garden solves that problem though(!)
(and eventually I upgraded my laptop to one with a PowerPC) |
Posted by: Phipli on 2023-03-27 15:01:17
I was sad when I started using RealBASIC since I'd been playing with demos of 2.1 and 3.5, but then when I bought my license (and I still have the original paperwork somewhere) I could only get 5.2...which couldn't make 68k apps! 🙁
These days the garden solves that problem though(!)
(and eventually I upgraded my laptop to one with a PowerPC) To this day I'd buy a v2.x or 3.x licence if I could.
The shame is that it is getting so much harder to look things up when you're stuck. I have the O'Reilly realbasic book, but am not sure if there is anything else I should grab for a more offline reference. |
Posted by: aladds on 2023-03-28 06:37:59 I was quite impressed that when I signed up for a Xojo account a little while ago I was able to have my 5.5.5 license added to the account since they still had a record of it. I didn’t ask if they would be willing to generate an older license for me, but since they didn’t back in 2004, I doubt they would now. |
| 1 |