Skip to content

Amzd/SwiftGtk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Swift 100.0%