I’ve subclassed a TCPSocket.
In an instance of my new subclass (called YTCPSocket), I don’t seem to be able to “Add” anything but Event handlers for the event definitions I created. All other items in the “Add To” context menu are greyed out on the instance.
I want to override existing methods on the subclass (or parent class) but just for this instance.
You need to make a real subclass, not just an item on a window.
So add a new class to project, set super to TCPSocker or whatever and then use that as super for the item on the window.
I Created a subclass from TCPSocket. RemoteSocket is an instance of YTCPSocket. I dragged YTCPSocket onto the project. Creates an instance but I cannot override any methods. Does dragging not create an instance of the subclass? If not, then what is it doing?
If YTCPSocket is the custom subclass you created, then THAT is where you add things… You cannot add/alter an INSTANCE of a class which is looks like RemoteSocket is
Correct. You cannot add a method to an instance of a class, only to the class object itself. You can then choose the instance of the class to not call that method.
Again, seems weird, but such is life with Xojo. Thanks, all…
Seems I cannot call RaiseEvent to a super’s Event Definition in my subclass.
Have to do a dumb workaround of creating a method in my super that calls the event…
no
basically on an INSTANCE you get to set properties that affect the behaviour
and you get to implement event handlers (which ARE the behaviour mostly)
after that methods are for every instance of the class