SDK for building cross-platform desktop apps in ANSI-C

Overview

NAppGUI

Cross-Platform C SDK. Build portable desktop applications for Windows, macOS and Linux, using just C.

NAppGUI Stack

Quick start in Windows

Prerequisites

Open the Developer Command Prompt

(from C:\)

// Clone the NAppGUI repo
git clone --depth 1 https://github.com/frang75/nappgui_src.git nappgui_sdk

// Create a build directory
mkdir nappgui_build
cd nappgui_build

// Generate the Visual Studio Solution
cmake -G "Visual Studio 16 2019" ../nappgui_sdk/src

// Build the examples
msbuild NAppGUI.sln

// Run examples in 'demo' and 'howto' folders
.\demo\die\Debug\Die.exe
.\demo\bricks\Debug\Bricks.exe
.\demo\products\Debug\Products.exe
.\howto\col2dhello\Debug\Col2dHello.exe
.\howto\guihello\Debug\GuiHello.exe
...

Running demo project in Windows

Quick start in macOS

Prerequisites

Open the Terminal

(from your home dir ~/)

// Clone the NAppGUI repo
git clone --depth 1 https://github.com/frang75/nappgui_src.git nappgui_sdk

// Create a build directory
mkdir nappgui_build
cd nappgui_build

// Generate the Xcode project
cmake -G "Xcode" ../nappgui_sdk/src

// Build the examples
xcodebuild

// Run examples in 'demo' and 'howto' folders
./demo/die/Debug/Die.app/Contents/MacOS/Die
./demo/bricks/Debug/Bricks.app/Contents/MacOS/Bricks
./demo/products/Debug/Products.app/Contents/MacOS/Products
./howto/col2dhello/Debug/Col2dHello.app/Contents/MacOS/Col2dHello
./howto/guihello/Debug/GuiHello.app/Contents/MacOS/GuiHello
...

Running demo project in macOS

Quick start in Linux

Prerequisites

// Development tools
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install git
sudo apt-get install make
sudo apt-get install cmake

// Development libraries
sudo apt-get install libgtk-3-dev
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install libcurl4-openssl-dev

Open the Terminal

(from your home dir ~/)

// Clone the NAppGUI repo
git clone --depth 1 https://github.com/frang75/nappgui_src.git nappgui_sdk

// Create a build directory
mkdir nappgui_build
cd nappgui_build

// Generate the Makefiles
cmake -G "Unix Makefiles" ../nappgui_sdk/src

// Build the examples
make

// Run examples in 'demo' and 'howto' folders
./demo/die/Debug/Die
./demo/bricks/Debug/Bricks
./demo/products/Debug/Products
./howto/col2dhello/Debug/Col2dHello
./howto/guihello/Debug/GuiHello
...

Running demo project in Linux

More info

Comments
  • Applications not sized correctly Ubuntu 18.04.

    Applications not sized correctly Ubuntu 18.04.

    For example the hello demo app only displays the title bar. Build from source is successful. I am surprised the application can not be resized/maximised either. Otherwise nice job Screenshot from 2022-04-10 18 57 11 Screenshot from 2022-04-10 18 57 50 !

    bug 
    opened by g8kig 19
  • [BUG] gifs are not played on linux

    [BUG] gifs are not played on linux

    https://user-images.githubusercontent.com/51754973/158998704-7f902b87-d582-4395-b90d-7d07c83aaac7.mp4

    tested on linux mint and arch linux. this is the binary that is downloaded here:https://nappgui.com/en/download/download.html I also compiled the library on my system with gcc 11 and it has the same issue.

    bug 
    opened by mohad12211 5
  • Build errors with CMake >= 3.21.2

    Build errors with CMake >= 3.21.2

    Hello! I'm excited to try this library out, but can't get the demos to build on my macOS system.

    I followed the macOS quick start instructions here. First, I get the CMake output as shown in this gist. Looks fine aside from the upfront warning about the CMake version (I'm using the latest 3.21.2).

    Then, running xcodebuild, I get the output in this other gist, with the first error shown on line 615.

    Error seems to emanate from draw2d_osx.ixx.

    Unfortunately, I'm not much of a macOS developer, so I'm not sure how one would even go about correcting this! (I guess I need to learn 😄)

    Thanks for any help on this!

    bug 
    opened by TheMartianObserver 4
  • right Shift + Tab doesnt move focus to previous control

    right Shift + Tab doesnt move focus to previous control

    Tested on windows 10, If I press the left side Shift + Tab the focus does move to previous control but shouldn't right side shift + Tab mimic the same, right now it's just moving to next element like as if right shift isn't pressed at all.

    bug 
    opened by 4silvertooth 2
  • fseek, ftell?

    fseek, ftell?

    From my point of view it's a very good idea to also include basic features in NAppGUI usually found in the C standard library to avoid compiler/platform dependencies.

    But I didn't find fseek nor ftell (or similar functionality), neither in Osbs nor in Core. Can you give me a hint please how I'm supposed to set a file position using NAppGUI?

    enhancement 
    opened by rochus-keller 2
  • Not able to make the Xcode project

    Not able to make the Xcode project

    Hi there... trying quickly I get this error:

    MBP:nappgui_build oldes$ cmake -G "Xcode" ../nappgui_sdk/src
    -- The C compiler identification is AppleClang 11.0.0.11000033
    -- The CXX compiler identification is AppleClang 11.0.0.11000033
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - failed
    -- Detecting C compile features
    -- Detecting C compile features - failed
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
    -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- broken
    CMake Error at /usr/local/Cellar/cmake/3.9.5/share/cmake/Modules/CMakeTestCXXCompiler.cmake:44 (message):
      The C++ compiler
      "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
      is not able to compile a simple test program.
    
      It fails with the following output:
    
       Change Dir: /Users/oldes/GIT/nappgui_build/CMakeFiles/CMakeTmp
    
      
    
      Run Build Command:"/usr/bin/xcodebuild" "-project"
      "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_cb4fb"
      "-configuration" "Debug"
    
      note: Using new build system
    
      2021-09-09 23:00:33.422 xcodebuild[33634:1747991] unable to create build
      operation: Error Domain=com.apple.xcbuild Code=1 "unknown error while
      handling message: missingTarget(guid:
      "1aba590e2e5c6a1873bb5978a646d793204a9ea3f8464f305b840440404ef12c")"
      UserInfo={NSLocalizedDescription=unknown error while handling message:
      missingTarget(guid:
      "1aba590e2e5c6a1873bb5978a646d793204a9ea3f8464f305b840440404ef12c")}
    
      
    
      ** BUILD FAILED **
    
    MBP:nappgui_build oldes$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --version
    Apple clang version 11.0.0 (clang-1100.0.33.8)
    Target: x86_64-apple-darwin18.7.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    
    MBP:nappgui_build oldes$ xcodebuild -version
    Xcode 11.0
    Build version 11A420a
    
    opened by Oldes 2
  • Fix xcode compiling big sur binary for catalina with Xcode <= 12.4

    Fix xcode compiling big sur binary for catalina with Xcode <= 12.4

    Hi

    This project looks truly incredible! i am baffled how you only have 195 stars, when that's said, thanks for making nappgui ❤️

    I stumbled upon this minor issue while building the project on macOS Catalina. Apple has gotten less consistent when it comes to removing support for Xcode, ie. not only at major increments... as such you can actually use Xcode 12 on Catalina up to 12.4, which this PR reflects.

    The "sw_vers" command has existed for all of mac os x lifetime, so it should be compatible with all mac os versions nappgui supports

    opened by MrStevns 1
  • Simplify warning suppression enable Ninja on WIN32

    Simplify warning suppression enable Ninja on WIN32

    I propose changing the visual C++ warnings into a CMAKE list for easier maintenance. A side effect of this is that Ninja builds for CI can be integrated.

    Documentation for the Ninja build

    // Batch build using Ninja build tool (VS 2022)
    // Generate the build
    cmake -DCMAKE_VS_PLATFORM_TOOLSET=v143 -G "Ninja" ../nappgui_sdk/src
    
    // Build the examples
    ninja
    
    opened by g8kig 0
  • How to working with the third-party static library(Ex: libusb-1.0.lib)

    How to working with the third-party static library(Ex: libusb-1.0.lib)

    Hello Frang: I'm new to NAppGUI and CMake. about below question I can't find any answer on Google.
    When add new project by command "desktopApp("TestUSB" "Ben/TestUSB" "" NRC_NONE)", and add the "target_link_libraries(TestUSB usb-1.0)" to CMakeLists.txt file on my new project folder , but this file will be updated automatic every time when CMake configure. How does the best way the NAppGUI working with a third-party library (Example; libusb-1.0.lib libusb-1.0.a ), if I don't want re-compiler the third-party library source code?

    documentation 
    opened by rick-hanpin 2
  • Modal Window Close Crash.

    Modal Window Close Crash.

    Hello,

    First thing I would like to mention, I really enjoy this library! Imo, easy to grasp and not really bloated like other libraries I've used prior.

    I've came across an issue on Windows. Whenever I would close a second window, using the [X] on the title bar, it would crash the whole program. After looking into the debug, it crashes at the strcmp between "bool_t" and an unknown value with "0x3f3f3f3f3f3f3f3f", and looking even more back the event->return_type inside event_result_imp() is also set to "0x3f3f3f3f3f3f3f3f".

    The good news, if I were to not use the [X] on the title bar, It wouldn't crash (eg. a push button, set to destroy the modal window).

    I have modified the "HelloWorld" main.c files to show you what I've encountered. I made sure that I did a fresh compilation of nappgui before sending this issue (using vs2022): win32_modal_crash.zip

    I also sent two pics (the actual modal window in where it would crash, and the event_result_imp 0x3f3f.) Hopefully this crash is easily replicated on your end. [Or hopefully this is just my machine and everything is truly ok, that works too lol]

    documentation enhancement 
    opened by dgramirez 1
  • GTK3 Window dimensions with Wayland

    GTK3 Window dimensions with Wayland

    The final size of NAppGUI Window in GTK is made in: https://github.com/frang75/nappgui_src/blob/main/src/osgui/gtk3/oswindow.c line 772, calling to gtk_widget_set_size_request(window->control.widget, (gint)width, (gint)height);

    The width and height values have been calculated by NAppGUI compositor.

    With Wayland backend, the window is sized slightly smaller than the width and height values. Specifically, 50 pixels less in width and 89 pixels less in height. With x11 backend the window is sized correctly.

    Study the case to determine if anything can be done within the NAppGUI code to make this work correctly in Wayland. Obviously, using width + 50, height + 89 if we detect the Wayland backend seems to solve the problem.

    At the moment, NAppGUI forces to use X11 as GDK_BACKEND in hopes of solving this problem.

    hello_gtk3

    dice_gtk3

    drawhello_gtk3

    urlimg_gtk3

    guihello_gtk3

    bug 
    opened by frang75 1
  • Binary files in the source code

    Binary files in the source code

    A lot of effort seems to have put into this project. I looks interesting and I would like to try it out, however when looking at the source code, I found binary files for various operating systems in subdirectories of the directory "prj". E.g. "prj/script/win/x64/nrc.exe", a file which even got 2 warnings when analyzing it via virustotal.com. I admit some false positives are normal. I want to trust the project, however I don't know why those binary files are there nor what they do, and why they need to be there in binary form instead of source code. Could you clarify it? Would it be possible to provide the source code? I am concerned about running binary files of unknown origin. Thanks for understanding.

    documentation 
    opened by hippie68 1
  • Dynamically unloading GUI elements

    Dynamically unloading GUI elements

    Hello,

    I'm working on a application that requires some dynamic UI behavior. In the context of this application this means adding and removing (not hiding but outright destroying) arbitrary GUI elements to a existing (and visible) window.

    Looking at the documentation and going through the examples I haven't found a way to achieve this.

    Is this something that is doable?

    Thank you!

    documentation 
    opened by kicsyromy 2
Releases(v1.2.3)
  • v1.2.3(Jun 5, 2022)

    Features

    • Linux ARM64 build support.
    • Build support for "AppleClang" compiler ID.

    Bug corrections

    • TextView rich text working on macOS
    • Solved compile warnings with macOS SDK 12.0
    Source code(tar.gz)
    Source code(zip)
  • v1.2.2(Apr 30, 2022)

    Features

    • GCC11 Ubuntu 22.04 support.

    Bug corrections

    • GTK3 issues in older versions (Ubuntu 12, 14, 16)
    • Proc deadlock in Win32 'bproc_read_close'
    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Apr 9, 2022)

    New API functions

    • buffer_const()
    • buffer_with_data()
    • heap_leaks()
    • heap_stats()
    • bfile_pos()
    • bfile_seek()
    • layout_dbind_update()
    • evbind_modify()
    • evbind_object()
    • r2d_centerf()

    Features

    • VisualStudio 2022 support.
    • Xcode 13 macOS Monterey support.

    Improvements

    • Containers 'const' treatment (Arrays, Sets).
    • Linux Gtk3/Curl/Pthread package dependencies management.
    • GUI data binding implementation and docs: https://nappgui.com/en/gui/gbind.html.

    Bug corrections

    • GIF animations in GTK/Linux.
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Oct 16, 2021)

Owner
Francisco García Collado
Lead developer at NAppGUI Cross-Platform C SDK.
Francisco García Collado
The Gecko SDK (GSDK) combines all Silicon Labs 32-bit IoT product software development kits (SDKs) based on Gecko Platform into a single, integrated SDK.

Silicon Labs Gecko SDK (GSDK) The Gecko SDK (GSDK) combines Silicon Labs wireless software development kits (SDKs) and Gecko Platform into a single, i

Silicon Labs 145 Nov 24, 2022
This plugin allows Flutter desktop apps to defines system tray.

tray_manager This plugin allows Flutter desktop apps to defines system tray. tray_manager Platform Support Quick Start Installation ⚠️ Linux requireme

LeanFlutter 116 Dec 2, 2022
This plugin allows Flutter desktop apps to Auto launch on startup / login.

This plugin allows Flutter desktop apps to Auto launch on startup / login.

LeanFlutter 43 Nov 26, 2022
This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut).

hotkey_manager This plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut). hotkey_manager Platform Support Quick Star

LeanFlutter 78 Nov 30, 2022
A set of very empty header files that can be used when building apps with Cosmopolitan

cosmo-include A set of very empty header files that can be used when building apps with Cosmopolitan Why? When you build an application with Cosmopoli

null 24 Oct 2, 2022
A framework for building native Windows apps with React.

React Native for Windows Build native Windows apps with React. See the official React Native website for an introduction to React Native. React Native

Microsoft 15.1k Nov 26, 2022
Appupdater is a C++ cross-platform framework to update desktop software (gitlab mirror)

appupdater is a C++ cross-platform framework to update desktop software. How it works Framework checks the URL you specified for info about versions a

Ronzhin Mikhail 1 Jan 8, 2022
A framework for building Mobile cross-platform UI

Weex A framework for building Mobile cross-platform UI. Distribution Support Android 4.1 (API 16), iOS 9.0+ and WebKit 534.30+. platform status Androi

Alibaba 18k Nov 26, 2022
POCO C++ Libraries are powerful cross-platform C++ libraries for building network

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

POCO C++ Libraries 6.5k Nov 29, 2022
First open-source Geometry Dash cross-platform Modding SDK

BoolkaSDK First open-source Geometry Dash cross-platform Modding SDK Requirements CMake 3.21 Android NDK r23 LLVM x86 Java and ApkTool Building Open C

null 7 Nov 20, 2022
The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system necessary

The Raspberry Pi Pico SDK (henceforth the SDK) provides the headers, libraries and build system necessary to write programs for the RP2040-based devices such as the Raspberry Pi Pico in C, C++ or assembly language.

Raspberry Pi 1.8k Nov 24, 2022
Run statically-compiled WebAssembly apps on any embedded platform

embedded-wasm-apps Run native, statically-compiled apps on any platform, using WebAssembly. Examples include AssemblyScript, Rust, C/C++, TinyGo, Zig,

Wasm3 Labs 111 Nov 18, 2022
The Leap Motion cross-format, cross-platform declarative serialization library

Introduction to LeapSerial LeapSerial is a cross-format, declarative, serialization and deserialization library written and maintained by Leap Motion.

Leap Motion (Ultraleap) 15 Jan 17, 2022
A cross platform shader language with multi-threaded offline compilation or platform shader source code generation

A cross platform shader language with multi-threaded offline compilation or platform shader source code generation. Output json reflection info and c++ header with your shaders structs, fx-like techniques and compile time branch evaluation via (uber-shader) "permutations".

Alex Dixon 285 Nov 16, 2022
Semantic version library written in ANSI C

semver.c Semantic version v2.0 parser and render written in ANSI C with zero dependencies. Features Standard compliant (otherwise, open an issue) Vers

Tom 170 Nov 28, 2022
Espressif ESP32 implementation of ANSI-ESTA E1.11 DMX-512A

This library allows for transmitting and receiving ANSI-ESTA E1.11 DMX-512A using an Espressif ESP32. It provides control and analysis of the packet configuration and allows the user to read synchronously or asynchronously from the DMX bus. This library also includes tools for data error-checking to safely process DMX commands.

null 115 Nov 28, 2022
ASMotor is a portable and generic assembler engine and development system written in ANSI C99

ASMotor is a portable and generic assembler engine and development system written in ANSI C99 and licensed under the GNU Public License v3. The package consists of the assembler, the librarian and the linker. It can be used as either a cross or native development system.

null 42 Nov 18, 2022
My ANSI C solutions for Advent of Code.

ansi-adventure My optimized ANSI C solutions for Advent of Code. I tried favoring speed and performance the most here than most advent of code repos.

2 Dec 12, 2021
an implementation of the ansi c standard library that makes sense when ur stoned, tired, or otherwise inebriated

eli5 c stdlib an implementation of the ansi* c standard library that makes sense when ur stoned, tired, or otherwise inebriated * apparently this (htt

Ellen Körbes 7 Oct 13, 2021