GTK# (GTK3 / C# / Glade / Visual Studio Code) Mac OSX

A Place to discuss programming languages, APIs and software development
Post Reply
User avatar
ZerOne
Site Admin
Posts: 116
Joined: Sun Dec 13, 2020 8:21 am

Introduction
GtkSharp is a .NET wrapper for the GTK library, enabling developers to create graphical user interfaces (GUIs) in C#.
It provides bindings for GTK and related libraries such as GLib, GDK, Pango, and Cairo, making it a powerful tool for cross-platform application development.

This quick guide introduces how to develop applications using GTK#
Specifically it includes instructions on how to use Glade and Visual Studio Code to write a C# application using GTK3.

This includes
* Installing the required prerequisites on Mac OSX
* Installing Glade (The Interface Designer)
* Installing Visual Studio Code
* Creating your first GTK# Program.


Key Features of GtkSharp
GtkSharp supports GTK 3.22 and is compatible with .NET Standard 2.0, making it suitable for modern .NET applications.
Unlike older versions, it does not require glue libraries, simplifying the setup process.
User avatar
ZerOne
Site Admin
Posts: 116
Joined: Sun Dec 13, 2020 8:21 am

Installing the Prerequisites

1) Install Homebrew

Code: Select all

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2) Install GTK3 and GTK Source

Code: Select all

brew install gtk+3

Code: Select all

brew install gtksourceview4
3) Install Glade, using the homebrew package manager

Code: Select all

brew install glade

4) Download the .NET framework for your operating system, using the following LINK

5) Install the .NET OSX Package.

6) Download Visual Studio Code for your operating system using this LINK

7) Install the Visual Studio Code OSX package

8) Open Visual Studio Code

9) On the top menu bar in Visual Studio Code, click on View -> Extensions to bring up the extensions pane

10) Search for the extension C# Dev Kit extension, from Microsoft, and install

11) Search for the extension C# extension, from Microsoft, and install
Post Reply

Return to “Programming and API Forums”