Sometimes its nice to be able to know what class defined a property or method. Introspection makes this mostly knowable.
The reason I say “mostly” is that something the introspection metadata does not tell you is if the property definition is local or inherited. So you cant tell for sure if a property in a subclass is one defined in the subclass or the inherited one from the superclass.… Read the rest
Shadowing is usually a bad thing. But you can “sort of” do it right as I explained previously. I say sort of because there are some gotcha’s – one of which I’ll explain here.
However, there are still gotcha’s that can’t be worked around. Some of them are because of how the Xojo framework does things.… Read the rest
Did you know that you can write, in the declaration pane for the method editor, the entire declaration and the editor will rip it apart for you ?
So instead of having type the name, tab, parameters, tab, return type, tab, select a scope you can type
Private Foo(i as integer) as string
and press tab or return and it will all get split into the right spots.… Read the rest
When you design classes you often make the properties they hold private or protected so outside code cant mess with the innards.
But what if you want to allow that – sometimes ?
This is the notion of a “friend”. Another class that you can literally say “yeah its ok I know them and it’s OK if they mess with my innards as they are my friend”.… Read the rest
Ever tried to copy an enum from some outside source like Apple, MSDN, etc and wanted to retain the comments they have about each value in the enumeration ?
You can !
Enum values can have comments in them like
Public Enum ConnectionOption
adConnectUnspecified = -1 // Default. Opens the connection synchronously (after).
adAsyncConnect = 16 // Opens the connection asynchronously (before).
… Read the rest
A question was asked the other day about “how can I list just all the Windows in my application” And that reminded me of something I added to the IDE some time back.
Advanced filters in the find field above the navigator. It has only a very short mention in the IDE user guide.
So if you want to find all the Windows in your application you can type something like this into the filter field
and press enter and you will see all windows and container controls listed (containers are window like objects hence why they are listed).… Read the rest
This isn’t just a Xojo debate. API 2.0 is reported to use exceptions rather than error codes.
And I’m sure that once preliminary releases of a version with API 2.0 are out that this debate will start in earnest.
Personally I’ve used both. The biggest difference with how I’ve used exceptions in the past in other languages was their built in support for “checked exceptions“.… Read the rest
In a previous post I showed how you could create a constructor that a layout could use but no other code could.
Seems that in oder to make this a little more generic and cross-platform you need to look for a different stack entry.
Because macOS and Windows do things differently you can get a very different stack trace on Windows that you would on the Mac.… Read the rest
At least IMHO they are not equivalent. Why not ?
Very useful words to keep in the communication between any company and its customers. Its not a promise. Just a rough outline of what things you are planning to do.
Some companies use phrases like this to let their customer base know “hey this is what we think we are going to be able to deliver” without having to promise a specific quarter or date.… Read the rest