Adding Event handlers

OK So now we have a control on a Window
But how do we react to events that happen to that control ?
Like KeyDown, Keyup, GotFocus, LostFocus, and TextChanged. Thats all the events there are on TextFields – for now.

In Xojo you’d just add the event handler to the control & put code in it.… Read the rest

Adding menubar & controls in C#

For all of you following along YEAH its about damned time ! 🙂
I agree

I’ve been proceeding slowly to make it so you can follow and not try to cram 10000 items in one post (we ARE trying to keep it manageable)

First Lets remove the last bits of “cruft” left in our getting starting project
Since we’re not actually using a normal macOS document application we can delete the ViewController.csRead the rest

Creating our Window in C#

So far when you run the project it will show a main window.
But this is because we created the kind of project we did with a main storyboard and an entry in the Info.plist that told macOS what should be the main window.

It isn’t one we created in our new framework.

Lets rectify that.… Read the rest

Getting Started with C#

Of course to follow along you’ll need to download and install VS for macOS

Once you have it you can easily start a new “solution”
This is MS’ term for what might roughly be the equivalent of a Xojo project (although its a bit more than that) But for now “Xojo project” is close enough.

Select “New”

Select Mac app in the left hand pane send select “Cocoa app” and make sure the language elector is set to C# (you can use others supported by C# but I’m going to focus on C#)

Press Continue

Give your project a name – I used getting_started

Note that in this pane you can select which version of macOS you want to deploy backwards to.… Read the rest

Adventures in C#

Yeah after all these years I’ve started writing some code in C#

Mostly as a way to work in something else
But also as a way to learn another language that I _might_ end up needing to use for client work. Thats a whole different story.

So I started just using a framework put together by Björn Eiríksson

Any first it was just learning how to write code, add event handlers, and generally just getting used to how this all worked, C# syntax (some very handy things there) and poking about.… Read the rest