A library for creating native cross-platform GUI apps

Related tags

GUI yue
Overview

Yue

A library for creating native cross-platform GUI apps.

Getting started

Examples

Issues

Feel free to ask any kind of questions in the issues page, but please use English since other users may find your questions valuable.

License

The Yue project is licensed under LGPL v2.1 with following exception:

  • If you did not modify Yue's source code, you have the permission to statically link Yue with your project, regardless of the license of your project.

The source code of Yue can also be distributed under other proprietary software friendly licenses if you make a commercial contract with the owners of the Yue project.

Contributor license agreement

By sending a pull request, you hereby grant to owners and users of Yue project a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works.

The owners of the Yue project will also be granted the right to relicense the contributed source code and its derivative works.

The files under docs/, scripts/ and sample_app/ are published under public domain, and contributions to those works will also be licensed so.

Comments
  • Problems creating Tables

    Problems creating Tables

    I am trying to create a simple app that only shows a table on screen using simpleTableModel with no luck, here are the attempts I've made without success and the errors that I've received:

    local contentView = gui.Container.create()
    win:setcontentview(contentView)
    local tabela = gui.SimpleTableModel.create(1)
    contentView:addchildview(tabela)
    
    >>>
    
    lua5.3: error converting arg at index 2 from yue.SimpleTableModel to yue.View
    stack traceback:
            [C]: in ?
            [C]: in method 'addchildview'
            teste.lua:14: in main chunk
            [C]: in ?
    
    local contentView = gui.Container.create()
    win:setcontentview(contentView)
    local tabela = gui.SimpleTableModel:create(1)
    contentView:addchildview(tabela)
    
    >>>
    
    lua5.3: error converting arg at index 1 from table to integer
    stack traceback:
            [C]: in method 'create'
            teste.lua:13: in main chunk
            [C]: in ?
    

    Since the manual don't have examples, I'm having problems working with this element. Adding rows to the table don't change the error FYI...

    bug 
    opened by gustavohmsilva 9
  • Toolbar Item

    Toolbar Item

    Hi,

    I sadly can't find any way to add a toolbar item to my toolbar on macOS.

    There is a definition of a toolbar item but I couldn't find how to append it to the toolbar.

    Thank you for your help!

    question 
    opened by eveningkid 7
  • Irregular behavior between addrow() and removerowat()

    Irregular behavior between addrow() and removerowat()

    I've noticed that although in this example below, the line disappear from the table view:

    btn_deletar.onclick = function() 
                    db.delete(conexao, entry_id:gettext()) 
                    tabela:removerowat(entry_id:gettext())
                    conexao:commit()
            end
    

    In this example, the exact opposite do not happen, the view isn't getting updated...

    btn_cadastrar.onclick = function() 
                    db.create(
                            conexao, entry_filme:gettext(), 
                            entry_produtora:gettext(), 
                            entry_ano:gettext()
                    ) 
                    tabela:addrow{
                            entry_filme:gettext(), 
                            entry_produtora:gettext(), 
                            entry_ano:gettext()
                    }
                    conexao:commit()
            end
    

    Is this intentional? As the table view don't have a :reloadview() or something similar, it is my understanding the both operations, adding rows and removing them should auto reload the table view. But when creating the new row, the database receive the data OK (proving that the data is flowing ok) but the view aren't reloaded as in removerowat()

    needs-more-information 
    opened by gustavohmsilva 6
  • High processor usage at solving non html url

    High processor usage at solving non html url

    When I tried to resolve url with extension other than .html - usage of processor drasticly increments. From about 0,5% of usage to about 26% at resolving that non-html url. And nothing change over time. Process still have that high processor usage. Second try of it make usage about 50%, third on about 75%.

    Reproducing To be able to reproduce this bug just use the sample code in the form of "Mugan", add two files test.html and test.css and make two anchors, one for each of them:

    <a href='mugan://app/test.html'>test.html</a>
    <a href='mugan://app/test.css'>test.css</a>
    

    First of them works great. But second makes process usage higher for nothing.

    bug windows 
    opened by MrMaxie 6
  • [Lua] TextEdit.shouldinsertnewline doesn't work

    [Lua] TextEdit.shouldinsertnewline doesn't work

    Code:

    local pickFolderForm = gui.TextEdit.create()
    pickFolderForm:setstyle{width= 400, height: 25}
    pickFolderForm:settext("Type in folder")
    
    function pickFolderForm.shouldinsertnewline( self )
        print(self)
        return false
    end
    

    Video: https://streamable.com/jpn4p

    bug needs-more-information windows 
    opened by khanhas 6
  • Compile with /MD?

    Compile with /MD?

    The current compile option is MT, and statically linked Lua. When using lua.exe to load yue.dll, it crashes. For example, a memory created by lua.exe is freed within yue.dll.

    enhancement needs-more-information windows 
    opened by actboy168 6
  • use scoped_refptr to create containter may cause segmentation fault on ubuntu16.04

    use scoped_refptr to create containter may cause segmentation fault on ubuntu16.04

    environment:

    ubuntu 16.04

    issue description

    ref-counted container may cause segmentation fault if setting on_draw event.

    sample code

      scoped_refptr<nu::Container> radarView = new nu::Container;
      radarView->SetStyle("position", "absolute", "width", radar_view_size, "height", radar_view_size, "top", 0, "right", 0);
      radarView->on_draw.Connect([&](nu::Container* self, nu::Painter* painter, const nu::RectF& dirty){
        std::cout << "container on_draw on rect: " << self->GetBounds().ToString() << std::endl;
        scoped_refptr<nu::Canvas> temp_canvas = new nu::Canvas(nu::SizeF(radar_view_size, radar_view_size), 1.0f);
        nu::RectF bounds = self->GetBounds();
        painter->DrawCanvas(temp_canvas.get(), nu::RectF(0, 0, bounds.width(), bounds.height()));
      });
    
    needs-more-information 
    opened by sunbingfengPI 6
  • Label component does not works as expected

    Label component does not works as expected

    There is some issue with the label component.

    1. The alignment is seems to not be "start" as pointed in https://libyue.com/docs/latest/js/api/textattributes.html, but may be center
    2. The wrap does not work in next example, but if change the label to "Lorem\nIpsum is ..." (adding new line in some place) then it works

    Example code:

    
    const main = () => {
      console.log('main window')
      this.window = gui.Window.create({})
      this.window.setContentSize({ width: 280, height: 300 })
      this.window.setTitle(`Some window`)
      this.window.setAlwaysOnTop(true)
      const contentView = gui.Container.create()
    
      const appNameElement = gui.Label.create('Some title')
    
      const messageElement = gui.Label.create('Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.')
      let defaultFont = gui.Font.default()
      messageElement.setFont(gui.Font.create(defaultFont.getName(), defaultFont.getSize() * 0.86, defaultFont.getWeight(), defaultFont.getStyle()))
      messageElement.setStyle({
        padding: 5,
        wrap: true,
        ellipsis: true,
        height: 80
      })
    
      contentView.addChildView(appNameElement)
      contentView.addChildView(messageElement)
      this.window.setContentView(contentView)
    
      this.window.setVisible(true)
      this.window.activate()
    }
    
    
    bug 
    opened by dimitrov-adrian 5
  • Way to package the app into a single executive?

    Way to package the app into a single executive?

    I really like the idea of yue, unfortunately the fact that it relies on a fork of node makes it incompatible with all the app packagers I've stumbled upon. Is there any way to turn a yue app to a simple to distribute executable?

    enhancement 
    opened by kuba-orlik 5
  • Cannot use mac menubar

    Cannot use mac menubar

    First of all, thank you for this awesome library! Do you have a patreon or github sponsorship option for this project I can contribute to? You should set one up if not!

    Here is the bug:

    Steps to reproduce:

    • Run muban example app (or any other yue app) under Mac OSX
    • Try to click menubar, note you cannot click items
    • Switch to another app, then back to muban
    • Note you can now click the menubar

    I am on Mac OSX 10.15 in case that matters. Yode v14.2.0

    I've tried things in code like deactivating and activating the window, hiding/showing the window, nothing seems to help. Only if you switch to another app, then back to a yue app does the menubar start working.

    Let me know if you need any other info or if you can think of a workaround. Thanks!

    opened by johnsusek 4
  • The text displayed by the label is incomplete

    The text displayed by the label is incomplete

    #30 has been fixed, but there are still bugs in some cases.

    local gui = require('yue.gui')
    
    local win = gui.Window.create{}
    win.onclose = function() gui.MessageLoop.quit() end
    
    local view1 = gui.Container.create()
    view1:setstyle { FlexGrow = 1 } 
    
    local view2 = gui.Container.create()
    view2:setstyle { Position = 'absolute' }
    view1:addchildview(view2)
    
    local label = gui.Label.create('测试测试')
    view2:addchildview(label) 
    
    win:setcontentview(view1)
    win:setcontentsize{width=400, height=400}
    win:center()
    win:activate()
    
    gui.MessageLoop.run()
    

    os : win10

    p

    bug windows 
    opened by actboy168 4
  • FileDialog setfolder unsupported in macOS App Sandbox

    FileDialog setfolder unsupported in macOS App Sandbox

    Yue Version: 0.10.3 Operating System: macOS

    I finally dug into a problem I was seeing with FileSaveDialog and discovered that :setfolder (NSSavePanel directoryURL property) does not work with App Sandbox. I'm not sure if it's a deliberate security design decision or an oversight by Apple, but I did manage to find a workaround--setting NSNavLastRootDirectory application preference just before creating the dialog. Oddly this workaround does not work if you also try :setfolder, so it requires a conditional to check whether running within the sandbox. Checking for a sandboxed environment turns out to be tricky to do correctly--need to query validity of app-sandbox entitlement on the running bundle. But a simple hack is to check for APP_SANDBOX_CONTAINER_ID environment variable (either NSProcessInfo environment or just POSIX getenv), though in theory that could produce false positives and maybe even false negatives.

    Not sure it's practical to fix this issue in Yue itself. Next week I'll try to at least create a PR to mention the limitation in the documentation.

    opened by wahern 0
  • Filters of FileDialog not working

    Filters of FileDialog not working

    Yue Version: [email protected] Operating System: Windows 11

    Code:

    let fp = '';
        const dialog = gui.FileOpenDialog.create();
        dialog.setTitle('Select Symbol File');
        dialog.setFilters([
            {description: 'Symbol File', extensions: ['jpg', 'png']}
        ]);
        if (dialog.runForWindow(win)) {
            fp = dialog.getResult();
            console.log(fp);
        }
    

    I tried changing the extension to *.png or .png neither worked.

    image

    opened by PTKDrake 1
  • Multi select for Table and cell alignment bug

    Multi select for Table and cell alignment bug

    Yue Version: 0.11.0 Operating System: MacOS 12.4 Monterey

    Can you add multi select for Table? I think this feature will really useful.

    And i got this view when use Table, the cell is not centered well (aligned to top): https://prnt.sc/mL-L24Icxo31

    This is great library, i hope development will continuously :)

    opened by dickysyaputra 0
  • When window frame is false,SetResizable function is useless

    When window frame is false,SetResizable function is useless

    Yue Version: latest Operating System: windows 10

    This is great project. Thanks very much!

    When window frame is false. The window can not be resizeable. even if I call SetResizable(true).

      nu::Window::Options winOption;
      winOption.frame = false;
      scoped_refptr<nu::Window> window(new nu::Window(winOption));
      window->SetResizable(true);
      window->SetContentSize(nu::SizeF(400, 200));
      window->Center();
    
    bug needs-more-information windows 
    opened by xland 2
Releases(v0.11.0)
Purely native C++ cross-platform GUI framework for Android and iOS development. https://www.boden.io

BODEN CROSS-PLATFORM FRAMEWORK Build purely native cross-platform experiences with Boden Website ⬡ Getting Started ⬡ API Reference ⬡ Guides ⬡ Twitter

Ashampoo Systems GmbH & Co KG 1.6k Dec 27, 2022
wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls.

About wxWidgets is a free and open source cross-platform C++ framework for writing advanced GUI applications using native controls. wxWidgets allows y

null 4.8k Jan 7, 2023
DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS).

A cross-platform desktop app framework based on Node.js and the system webview

Wang, Chi 1.8k Jan 4, 2023
A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs.

webview for golang and c/c++ A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. The goal of the project is to

polevpn 21 Dec 3, 2022
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Immediate Mode UIs, Nuklear, etc. 6.7k Dec 24, 2022
Cross-platform GUI library

Harbour Nuklear backend This backend provides support for Nuklear. It works on on all supported platforms with an OpenGL backend, including iOS and An

Rafał Jopek 2 Jan 19, 2022
U++ is a C++ cross-platform rapid application development framework focused on programmer's productivity. It includes a set of libraries (GUI, SQL, Network etc.), and integrated development environment (TheIDE).

Ultimate++ Ultimate++ is a C++ cross-platform rapid application development framework focused on programmers productivity. It includes a set of librar

Ultimate++ 564 Jan 8, 2023
A cross-platform GUI for jzIntv

jzIntvImGui Welcome to jzIntvImGui! It's an all-in-one powerful Dear ImGui interface which allows you to manage your collection of Intellivision games

null 6 Nov 24, 2022
FLTK - Fast Light Tool Kit - a cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11)

FLTK - Fast Light Tool Kit - a cross-platform C++ GUI toolkit for UNIX(r)/Linux(r) (X11)

The FLTK Team 1.1k Dec 25, 2022
This is a collection of widgets and utilities for the immediate mode GUI (imgui) that I am developing for the critic2 GUI

ImGui Goodies This is a collection of widgets and utilities for the immediate mode GUI (imgui) that I am developing for the critic2 GUI. Currently, th

null 95 Nov 19, 2022
Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. 🚀

NodeGui Build performant, native and cross-platform desktop applications with Node.js and CSS like styling. ?? NodeGUI is powered by Qt5 ?? which make

NodeGui 8.1k Dec 30, 2022
GTK is a multi-platform toolkit for creating graphical user interfaces.

GTK — The GTK toolkit General information GTK is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets,

GNOME Github Mirror 1.1k Dec 31, 2022
Create macOS universal binaries of your Qt apps

With Apple transition from Intel to Apple Silicon (arm64) CPUs, developers have to deal with Universal binaries in macOS (again) in order to support t

CrystalIDEA Software 60 Dec 25, 2022
Cross-platform malware development library for anti-analysis techniques

The Anti-Analysis Menagerie Cross-platform malware development library for anti-analysis techniques. Design Goals Provide a rich and convenient interf

Alan 21 Sep 16, 2022
Open Source, cross platform C++ library providing integration of VulkanSceneGraph with Qt windowing

Open Source, cross platform C++ library providing integration of VulkanSceneGraph with Qt windowing. Supports Windows, Linux and macOS.

Vulkan made easy 14 Nov 23, 2022
NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3.x/DirectX11[12]/Vulkan. It supports automatic layout generation, stateful

dalerank 73 Dec 22, 2022
Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)

A tiny cross-platform webview library for C/C++/Golang to build modern cross-platform GUIs. Also, there are Rust bindings, Python bindings, Nim bindings, Haskell, C# bindings and Java bindings available.

webview 10.8k Jan 9, 2023
Elements C++ GUI library

Elements C++ GUI library Introduction Elements is a lightweight, fine-grained, resolution independent, modular GUI library. Elements is designed with

Cycfi Research 2.5k Dec 30, 2022
Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL

NanoGUI NanoGUI is a minimalistic cross-platform widget library for OpenGL 3+, GLES 2/3, and Metal. It supports automatic layout generation, stateful

Mitsuba Physically Based Renderer 1.2k Dec 28, 2022