Calling Super in Objective-C lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- syntonica · 2019-12-19 02:21 Here's what I got: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$mode objfpc}{$modeswitch objectivec1}  procedure MyNSViewSubclass.keyDown(theEvent: NSEvent);var  Consumed: Boolean; begin  { do some stuff, but we aren't going to consume the event }  if not Consumed then super.keyDown(theEvent);  // [super keyDown:theEvent]end;  How do I effect the call to super to pass the event along?  I've tried many variations, searched in all the usual places, no luck... ---------------------------------------------------------------------- syntonica · 2019-12-19 07:01 Finally found it! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not Consumed then Inherited keyDown(theEvent); Not exactly an obvious construct. ---------------------------------------------------------------------- Thaddy · 2019-12-19 07:21 Why? Technically inherited and super are similar, just differently named in the different languages. Both mean to allow you to use the implementation of the current class its  ancestor. I wrote similar, because there are some differences: e.g. in Objective C, you can dispatch messages to the super class(es) directly, using objc_msgSendSuper (xxx) and is static, whereas Object Pascal class dispatching is dynamic through its VMT. ---------------------------------------------------------------------- PascalDragon · 2019-12-19 08:21 Quote from: syntonica on December 19, 2019, 08:01:51 amFinally found it! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not Consumed then Inherited keyDown(theEvent); Not exactly an obvious construct.  It is in Object Pascal. Here, it's documented. It isn't that far- fetched that Objective Pascal uses the same way to call a parent's method. ---------------------------------------------------------------------- syntonica · 2019-12-19 08:26 Quote from: Thaddy on December 19, 2019, 08:21:05 amWhy? Because I just spent spent the day translating [bracketed things] into dotOperator.things and "Inherited" doesn't follow the pattern. Only reason I found it is that I was looking at the Java->Pascal page. ---------------------------------------------------------------------- syntonica · 2019-12-19 08:33 Quote from: PascalDragon on December 19, 2019, 09:21:35 amQuote from: syntonica on December 19, 2019, 08:01:51 amFinally found it! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not Consumed then Inherited keyDown(theEvent); Not exactly an obvious construct.    It is in Object Pascal. Here, it's documented. It isn't that far- fetched that Objective Pascal uses the same way to call a parent's method. I was assuming there was a special construct for this.  Now there will be a Google entry forever associating 'super' with 'Inherited' so other poor souls following in my footsteps don't get as lost.  Anyway, I'm finally getting close to a clean compile, although there are a couple of ugly bumps in the road ahead due to some changes I made deep in the bowels of my engine.  Fortunately, FPC never complains about how many times I invoke it. Just my bad code.