Skip to content

zhaozg/lui

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 7, 2019 21:56
February 23, 2017 16:22
May 27, 2018 14:47
December 18, 2018 21:04
January 28, 2019 22:31

lui, libui bare bindings for lua

libui bare bindings for luajit and lua 5.1/ 5.2/ 5.3.

This binding makes libui available to lua scripts. libui is easy binding and should usable from nearly any lua project.

Notice

  • Because lua is missing native threads support, so threads feature maybe lost.
  • Because libui/lui is not mature enough, you maybe encounter strange bugs.

Examples

Examples can be found in the examples folders, those are translate from examples.

Buliding

Checkout source

  git checkout  https://github.com/zhaozg/lui.git
  cd lui
  git submodule init
  git submodule update

Building on linux or macOS

  cd lui
  make install

Building on Windows

TODO

APIs

  • All top level functions are in the table returned by require
  ui = require'lui'  -- type(ui) is 'table'
  • All module level uiXXXX() functions are accessible as ui.XXXX(), they are include
    • Init
    • Uninit
    • Main
    • MainStep
    • MainSteps
    • timer
    • Quit
    • QueueMain
    • OnShouldQuit
    • OpenFile
    • SaveFile
    • MsgBox
    • MsgBoxError.
  assert(ui.Init())
  ui.Quit()
  ui.Uninit()
  • New objects are created with ui.NewXXX() or ui.DrawNewXXXX(), the are include
    • NewArea
    • NewButton
    • NewCheckbox
    • NewCombobox
    • NewColorButton
    • NewDateTimePicker
    • NewDatePicker
    • NewEditableCombobox
    • NewEntry
    • NewFontButton
    • NewForm
    • NewGrid
    • NewGroup
    • NewHorizontalBox
    • NewHorizontalSeparator
    • NewLabel
    • NewMenu
    • NewMultilineEntry
    • NewNonWrappingMultilineEntry
    • NewPasswordEntry
    • NewProgressBar
    • NewRadioButtons
    • NewSearchEntry
    • NewSlider
    • NewSpinbox
    • NewTimePicker
    • NewTab
    • NewVerticalBox
    • NewVerticalSeparator
    • NewWindow
    • DrawNewAreaHandler
    • DrawNewBrush
    • DrawNewPath
    • DrawNewMatrix
    • DrawNewStrokeParams
    • DrawNewTextLayout
    • DrawListFontFamilies (Special)
    • DrawLoadClosestFont (Special)
  wnd = ui.NewWindow(...) -- type(wnd) is userdata with metatable 'libui.Window'
  • All object perperties like uiTypeValue() and uiTypeSetValue() are accessible as obj:Value()
  entry:Padded(true)  -- just call uiEntrySetPadded(entry,1) and return object itself
  entry:Padded()      -- just call uiEntryPadded(entry) and return boolean type padded value
  • Object Append() methods take a variable number of arguments, allowing things
  `ui.NewRadioButtons():Append("One", "Two", "Three")
  • All object functions like uiTypeMethod() are accessible as obj:Method() calls
  wnd:Show()
  wnd:OnClosing(onclosing_cb)

You need read examples to be familiar with them.

Thanks

About

libui bare bindings for lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published