create window OS X lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Key-Real · 2021-04-18 10:58 I'm so far: 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}{$H+}{$modeswitch objectivec1} uses   gl, MacOSAll, CocoaAll; type   { MyCallback }   MyCallback = objcclass(NSObject)   public     procedure haltMenuEvent(sender: id); message 'haltMenuEvent:';   end; var   pool     : NSAutoreleasePool;   filemenu : NSMenu;   subitem  : NSMenuItem;   app      : NSApplication;   callback : MyCallback;   MainWindow: NSWindow;   MainView: NSView;   R: NSRect; function NSStr(const s: AnsiString): NSString;begin   if s='' then Result:=NSString.alloc.init   else Result:=NSString.alloc.initWithCString(@s[1]);end; { MyCallback } procedure MyCallback.haltMenuEvent(sender:id);begin   WriteLn('HALT!');   app.stop(self);end; procedure initMenus;var   root      : NSMenu;   rootitem  : NSMenuItem;begin   root:=NSMenu.alloc.init;   rootitem:=root.addItemWithTitle_action_keyEquivalent(NSStr(''), nil, NSStr(''));   filemenu:=NSMenu.alloc.initWithTitle(NSStr('File'));   rootitem.setSubmenu(filemenu);   rootitem.setEnabled(true);subitem:=f ilemenu.addItemWithTitle_action_keyEquivalent(NSStr('Halt'), nil, NSStr(''));   subitem.setEnabled(true);   app.setMainMenu(root);end; procedure InitCallback;begin   callback:=MyCallback.alloc;   subitem.setAction(ObjCSelector(callback.haltMenuEvent));   subitem.setTarget(callback);end; begin   pool:=NSAutoreleasePool.alloc.init;   app:=NSApplication.sharedApplication;      R.origin.x := 300.0;     R.origin.y := 300.0;     R.size.width := 300.0;     R.size.height := 300.0;      MainWindow := NSWindow.alloc.initWithContentRect_styleMask_backing_defer(R,     NSTitledWindowMask or NSClosableWindowMask or NSMiniaturizableWindowMask or NSResizableWindowMask,     NSBackingStoreBuffered, False);      MainWindow.orderFrontRegardless;      MainWindow.setTitle(NSSTR('Title'));      R.origin.x := 0.0;     R.origin.y := 0.0;     MainView := NSView.alloc.initWithFrame(R);     MainWindow.setContentView(MainView);    initMenus;   initCallback;   app.run;   pool.release;end. Is it possible to do a moin loop like the: 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 repeat updatemessages;  // windows styleuntil true; or is there only one option to go with callbacks and app.run; ? [Edited to add code tags - please see How to use the Forums.] ---------------------------------------------------------------------- lucamar · 2021-04-18 12:08 Please, use code tags ...