Giter VIP home page Giter VIP logo

nimgtkdsl's Introduction

GTK_DSL

A DSL for building simple GUI nim application. Based on gtk.

From now, only Button, Label, DrawingArea, V/HBox

Principes

window

A window is created, by apply a command to a string ... the string become the title of the window:

include gtk_dsl
"title of window".gtk_app(200,230):  # 200,300 : minimum width/heigth of the window
  ....descibe the containt of the window

stack

stack put widget in vertically order :

"title of window".gtk_app(200,230):  # 200,300 : minimum width/heigth of the window
  stack:
      label "A "
      label "B "

this create 2 labels , each one share the verticale space when the windo is resizable (by mouse action)

flow

Flow put widget horizontally :

"title of window".gtk_app(200,230):
  flow:
      label "A "
      label "B "

*i commands

Using *i commande, the widget use only necessary space for his display.

"title of window".gtk_app(200,230):
  stack:
      labeli "A "
      label "B "

This create a label "A', and fill the bottom window with the label B. resizing the window, 'A' keep his space, 'B' expand to all space disponible.

Other example: a text pannel with two button bottom :

"title of window".gtk_app(200,230):
  stack:
      label "A "
      flowi:
        button("A")
        button("B")

A label take all space, a line of buttons is keeping at button.

TODO

  • objectify (too much globals variables)
  • add style
  • support a bunch of widget
  • tests unit
  • not yet a nimble module...

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.