Create cross platform #GUI using #GTK
To skip to the code example, here it is on GitHub;
https://github.com/infiniteloopltd/HelloWorldGTK/
GTK# is an option that is available under Visual Studio for Mac under Other > .NET > GTK# 2.0, and it allows you to create windows-forms like GUIs that work cross platform, using the .NET Core framework. Above is a simple application that shows the user’s current IP address.
using System;
using System.Net;
using Gtk;public partial class MainWindow : Gtk.Window
{
public MainWindow() : base(Gtk.WindowType.Toplevel)
{
Build();WebClient wc = new WebClient();
var strIP = wc.DownloadString(“http://icanhazip.com”);
label2.Text = strIP;}
protected void OnDeleteEvent(object sender, DeleteEventArgs a)
{
Application.Quit();
a.RetVal = true;
}
}