GithubHelp home page GithubHelp logo

philippmdoerner / owlkettle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from can-lehmann/owlkettle

0.0 1.0 0.0 8.87 MB

A declarative user interface framework based on GTK 4

License: MIT License

Nim 100.00%

owlkettle's Introduction

Owlkettle

Freshly brewed user interfaces.

Owlkettle is a declarative user interface framework based on GTK. It is written in Nim.

Here is an example for a simple counter app. When you click on the "+" Button, the counter increments.

import owlkettle

viewable App:
  counter: int

method view(app: AppState): Widget =
  result = gui:
    Window:
      title = "Counter"
      defaultSize = (200, 60)

      Box(orient = OrientX, margin = 12, spacing = 6):
        Label(text = $app.counter)
        Button {.expand: false.}:
          text = "+"
          style = [ButtonSuggested]
          proc clicked() =
            app.counter += 1

brew(gui(App()))

The code above will result in the following application:

Counter Application

Owlkettle also supports building libadwaita apps. To enable libadwaita, import owlkettle/adw and change the last line to adw.brew(gui(App())).

Counter Application using Adwaita Stylesheet

Installation

Owlkettle requires GTK 4 to be installed on your system. You can install it by running:

  • dnf install gtk4-devel libadwaita-devel on Fedora
  • apt install libgtk-4-dev libadwaita-1-dev on Ubuntu
  • pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-libadwaita on Windows' MSYS2
$ nimble install owlkettle

Check out the installation guide for further instructions.

Documentation

You can find a reference of all widgets in docs/widgets.md.

A tutorial for building a simple Todo application can be found here.

Additional examples can be found here.

A reference of all supported libadwaita widgets can be found in docs/widgets_adwaita.md.

License

Owlkettle is licensed under the MIT license. See LICENSE.txt for more information.

owlkettle's People

Contributors

aleksrutins avatar beef331 avatar can-lehmann avatar ire4ever1190 avatar jiro4989 avatar nylki avatar philippmdoerner avatar planetis-m avatar rickbarretto avatar sirolaf avatar solitudesf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.