SwiftGtk

main

SwiftGtk provides a Swift wrapper for Gtk. It is currently in development.
stackotter/SwiftGtk

SwiftGtk

SwiftGtk provides Swift bindings for Gtk+ 3. It currently supports both macOS and Linux (with Windows support planned).

Dependencies

  1. Swift 5.5 or higher
  2. Gtk+ 3
  3. clang (only required on Linux)

macOS: Installing Gtk+ 3

Install Gtk+ 3 using homebrew or the package manager of your choice.

brew install gtk+3

Linux: Installing Gtk+ 3 and clang

Install Gtk+3 and Clang using apt or the package manager of your choice.

sudo apt install libgtk-3-dev clang

Usage

Add SwiftGtk as a dependency of your project using Swift Package Manager. Below is an example package manifest that has SwiftGtk as a dependency.

import PackageDescription

let package = Package(
  name: "GtkHelloWorld",
  dependencies: [
    .package(url: "https://github.com/stackotter/SwiftGtk", .branch("main"))
  ],
  targets: [
    .executableTarget(name: "GtkHelloWorld", dependencies: ["SwiftGtk"])
  ]
)

Demo

First install the required dependencies as listed above. And then run the following commands:

git clone https://github.com/stackotter/SwiftGtk
cd SwiftGtk
swift run Demo

macOS

macOS

License

All code is licensed under MIT license.

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Mar 29 2024 19:54:33 GMT-0900 (Hawaii-Aleutian Daylight Time)