Giter Club home page Giter Club logo

crowngui's Introduction

crowngui

Web Technologies based Crossplatform GUI Framework

It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and IE on Windows

Notice: I mainly work on macOS, also it has well document of Cocoa/WebKit, contribute to Linux and Windows are welcome, the windows binding will change to Edge and webview2 api in the future.

CLI tool:
crowncli for build application.

Usage

file: yourexecutable.nim

import crowngui

when isMainModule:
  const   
    cssDark = staticRead"assets/dark.css".strip.unindent.cstring
    cssLight = staticRead"assets/light.css".strip.unindent.cstring

  let app = newApplication( staticRead("assets/demo.html") )
  when not defined(bundle):
    let theme = if "--light-theme" in commandLineParams(): cssLight else: cssDark
    app.css(theme)
  app.run()
  app.exit()

Your project .nimble file

bin           = @["yourexecutable"]

crowncli will bundle your executable to exe on windows, .app on mac

Your project root can have "logo.png" which will generate as icon of application.

CLI usage

crowncli [build,run] --help

Usage:
  [build,run] [required&optional-params] [flags: string...]
Options:
  -h, --help                         print this cligen-erated help
  --help-syntax                      advanced: prepend,plurals,..
  -t=, --target=   string  REQUIRED  set target
  -w=, --wwwroot=  string  ""        set wwwroot
  -r, --release    bool    false     set release

Examples

crown_excel crowngui based excel viewer

Prerequires

rcedit for windows exe icon on non-windows platform requires wine

Development

run
crowncli run --target macos

build
crowncli build --target macos

Cross compilation for Windows

To cross compile for Windows from Linux or macOS using the MinGW-w64 toolchain:

nim c -d:mingw myproject.nim

Use --cpu:i386 or --cpu:amd64 to switch the CPU architecture.

The MinGW-w64 toolchain can be installed as follows:

Ubuntu: apt install mingw-w64
CentOS: yum install mingw32-gcc | mingw64-gcc - requires EPEL
OSX: brew install mingw-w64

crowngui's People

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.