GTK4 `dotnet new` Project Template

Rmag Breaking News

I have been writing some samples using GTK4 using GirCore so its time to reduce the manual project setup steps and turn it into a dotnet new project template.

Project Template

Time to follow the excellent article by Syed Ibrahim.

I have taken out the project setup section from my GTK 4 tutorials and turned it into the template. I have created a console application, added GirCore.Gtk-4.0 nuget package to the project and updated the Program.cs to create a main Gtk window with Hello World label.

Next tutorial for GTK4 hopefully I will use this template to bootstrap the project. And I will keep it updated with new releases of GirCore.

Usage

Clone repository locally

Build nuget package
dotnet pack -o .

Install template for dotnet new using following command
dotnet new install Gtk4.Templates.1.0.0.nupkg

Create new project using template
dotnet new gtk4-app –param:name [ProjectName]
OR
dotnet new gtk4-app -p:n [ProjectName]

Uninstall template using following command
dotnet new uninstall Gtk4.Templates

Source

Source code for the template is available on GitHub in gtk4-dotnet-template repository.

References & Resources

dotnet new

dotnet-template-samples

How to create your own templates for dotnet new

templating

Gir.Core

Leave a Reply

Your email address will not be published. Required fields are marked *