An interesting question posed by a relatively new user came up on the forums. It had to do with how the Array() function worked and how he could force it to return an array of variants to call his method.
His method was defined like
BuildMenu( base as menuitem, params() as variant)
And he would call it like
Result = BuildMenu (base, Array ("Run", False, "Edit", "Rename", "Delete") )
and this would build up a menu from the base item and append menu items to it.… Read the rest
Normally a listbox doesnt support much in the way of live resizing of rows or columns if you dont have a header row.
Turns out that for something else I’m working on I needed to be able to resize things and NOT have a header row – and also make it possible to resize rows as well by clicking & dragging.… Read the rest
I know a lot of you don’t want to mess with Xcode BUT there are some really handy things it can help you with and you don’t have to write any Swift or Objective-C code.
Since you can drop a plist into Xojo to supplement or replace certain keys at some point you may need to create one.… Read the rest
Suppose you are creating a new container control to encapsulate some functionality onto this new control. You’re already thinking about “encapsulation” which is a good thing.
Why, when you create this new container, would you then make all the controls on it public so code outside the container can change it ? That seems like it would be a good way to ruin the encapsulation you’re trying to achieve.… Read the rest
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
Originally published on my old blog March 12, 2019
After Joe Ranieri quit* & moved to a new job I think everyone felt stressed. I know I did. It felt like so much more was expected of an ever smaller group of engineers.
By Dec of that year I’d had enough of the forums and some of the general dumping on Xojo as a product.… Read the rest