Gtk-Workload

From Wiki Maui Linux NET
Jump to navigation Jump to search
Gtk Workload
Developer(s) HavenDV
Initial release 2024
Latest version
Programming language C#, PowerShell, Shell
Operating system Cross-platform
Platform .NET 6/7/8
Type .NET workload / GTK integration
License MIT License
Website GitHub repository


Gtk Workload is an open-source project by HavenDV that provides a dedicated .NET workload for the GTK toolkit. It enables developers to define a distinct TargetFramework Moniker (TFM) such as net7.0-gtk (or higher) within a single-project solution, differentiating it from standard net7.0 builds.

Overview

The project extends the .NET SDK by introducing a workload manifest, build targets and templates tailored for GTK applications. It allows GTK support to be integrated in the same way as other official .NET workloads, simplifying the setup and configuration of cross-platform desktop GUI applications.

Features

  • Adds a custom TFM like netX.Y-gtk, enabling single-project solutions using GTK.
  • Provides installer scripts for Linux/macOS and Windows for installing the workload.
  • Compatible with .NET 6, .NET 7, .NET 8 (and possibly newer) SDKs.
  • Licensed under the MIT License.

Installation

Linux/macOS

curl -sSL https://raw.githubusercontent.com/HavenDV/Gtk/main/scripts/workload-install.sh | sudo bash

Windows

Invoke-WebRequest 'https://raw.githubusercontent.com/HavenDV/Gtk/main/scripts/workload-install.ps1' -OutFile 'workload-install.ps1'
.\workload-install.ps1 [-v <version>] [-d <directory>]

In your project file (.csproj):

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net7.0-gtk</TargetFramework>
  </PropertyGroup>
</Project>

Advantages

  • Simplifies cross-platform GUI development using GTK and .NET in a unified project.
  • Lets developers avoid splitting logic and UI into separate projects purely for GTK support.
  • Aligns with .NET workload model used by mobile/desktop frameworks (e.g., MAUI, Tizen).

Considerations & Limitations

  • Requires that the underlying GTK runtime and native libraries are installed on the target system.
  • As a community-driven workload, future SDK changes may require updates or maintenance.
  • At present, may still be considered experimental; verify compatibility with your target .NET/GTK versions.

See also

  • GtkSharp — .NET bindings for GTK.
  • GTK — The native toolkit for graphical user interfaces.
  • .NET workloads — Official documentation of .NET SDK workload design.