BinaryStream Class

I can’t give you proper code because I do mainly web services code.

But maybe you’re setting the menu from the App object before the Window has loaded?

I would imagine you need to attach the menu bar to the Window in code or else make sure it’s dragged onto the Window in the IDE, not just into the Navigator. If this doesn’t help then I suggest you start another forum thread so a desktop programmer can help you.

I get it. Looking at my code written 12 years ago I notice I could actually think 10 move ahead and as I head for 70 I can manage about 2.

Never thought of oop as a prolonging my coding days but maybe it will :wink:

1 Like

Do you already have a BinaryStream class that you’re using for other things? If so, then add this code as a Shared method, so you don’t have to have an instance to call it. If not, then put this code elsewhere, either in a Prefs class (if you already have one) or a Prefs module.

You should only create a subclass if you’re modifying its behavior. If all you’re doing is creating shared methods, then a subclass is not appropriate.

What do you mean by “Prefs” Tim?

Preferences. His variable names indicate he’s dealing with prefs.

Wouldn’t that BinaryStream class need to be instanced somewhere first or does the shared method make it so you do not?

Also, Tim could you respond to the Menu bar issue if you have an idea. The menu bar and event handler are where they should be but I have lost association by dragging a new one in.

The Shared method makes it so you don’t nee an instance to call it.

I’d need a little more info about the menu bar. Did you set the window’s MenuBar property to the new menu bar?

What is the Type of HeatingSeason_Mode?

Where do you find the menu bar property?

It’s in the inspector properties for the window.

That’s no fair XOJO is just trying to kill me. I found it and it was none. I selected it and it said sorry not this time. Did not work. Hmm!

That actually did work Tim. I was fighting two issues, one being the prefs setting and the other my stupidity.

Tim, correct me if I’m wrong but if I follow you there is no need to create a subclass from let us say dictionary unless you are adding properties or methods, I guess that’s modifying its behavior maybe. If that’s the case use a module to hold your method and prefs that you do not wish to create instances of. Creating shared methods is like putting the method in a module anyway.