Skip to content

iffy/wiish

Repository files navigation

Build Status Windows build status

Docs | Changelog

Wiish (Why Is It So Hard) GUI framework might one day make it easy to develop, package and deploy auto-updating, cross-platform applications for desktop and mobile. If it succeeds, maybe the name will have to change :)

Wiish is currently ALPHA quality software. Don't make anything with it unless you're willing to rewrite it when this package changes.

Quickstart

  1. Install Nim and nimble

  2. Install Wiish:

    nimble install https://github.com/iffy/wiish.git
    
  3. Install other dependencies:

    Run wiish doctor to see what you need installed. It will probably be:

    • Ubuntu: apt-get install libsdl2-dev libsdl2-ttf-dev libgtk-3-dev libwebkit2gtk-4.0-dev
    • macOS: Xcode
    • Windows: Don't know yet
  4. Create a project and run it:

    wiish init somedir
    cd somedir
    wiish run
    

See wiish --help for how to build executables and apps and configure a project. For example:

wiish doctor
wiish run --os ios
wiish run --os android
wiish build
wiish init --base-template opengl my_opengl_app

Features

Wiish provides these main things:

  1. wiish - A command line tool for running, building and packaging apps.
  2. wiish - A Nim library import wiish/... for help with making apps.

Plugins

Wiish uses a plugin system to support various GUI methods:

  • wiish/plugins/webview - For build webview-based apps.
  • wiish/plugins/sdl2 - For SDL and OpenGL apps.

The GUI component is designed to work separately from other features (e.g. auto-updating, packaging, etc...) so that different GUI libraries can be swapped in/out.

Support

  • macOS

    • wiish run
      • webview
      • OpenGL
      • SDL2
    • wiish build --target app
      • webview
      • OpenGL
      • SDL2
    • wiish build --target dmg
  • Windows

    • wiish run
      • webview
      • OpenGL
      • SDL2
    • wiish build --target exe
      • webview
      • OpenGL
      • SDL2
    • wiish build --target win-installer
  • Linux

  • iOS

    • wiish run
      • webview
      • OpenGL (doesn't handle events yet)
      • SDL2
    • wiish build --target ios-app
      • webview
      • OpenGL
      • SDL2
  • Android

    • wiish run
      • webview
      • OpenGL
      • SDL2
    • wiish build --target apk
      • webview
      • OpenGL
      • SDL2
  • Mobile dev (runs mobile app on desktop)

  • App icon

    • macOS
    • Windows
    • Linux
    • iOS
    • Android
  • wiish run logs to stdout

    • macOS
    • Windows
    • Linux
    • iOS
    • Android
  • Log to file

    • macOS
    • Windows
    • Linux
    • iOS
    • Android
  • Code signing

    • macOS .app
    • iOS .app
    • macOS notarizing
  • Include static resources in built app

    • macOS
    • Windows
    • Linux
    • iOS
    • Android
  • Automatic updates

  • File associations

  • Menu bar

Examples

See the examples directory for more examples of how to use this library. You can also initialize a project using these examples with wiish init. See wiish init --help for information.

Developing wiish

See CONTRIBUTING.md for information about contributing to Wiish development.

Webview messaging

When using the wiish/plugins/webview plugin, you send/receive strings between JavaScript and your Nim like this:

In JavaScript do this:

window.wiish = window.wiish || {};
wiish.onReady = () => {
    wiish.onMessage(message => {
        // Handle message from Nim
    })
    wiish.sendMessage("Hello Nim! -Sincerely JavaScript");
}

In Nim do this:

import wiish/webview_mobile

app.launched.handle:
    app.window.onReady.handle:
        app.window.sendMessage("Looks like you're ready, JS!")
    app.window.onMessage.handle(message):
        app.window.sendMessage("Thanks for the message, JS.")

A note on quality

This library works as advertised, but it is a huge mess. I'm learning as I'm going, and trying to wrangle all these platforms is ridiculous. I happily welcome suggestions (and pull requests).

About

Why Is It So Hard (to make a cross-platform app)?

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •