Skip to content

Instantly share code, notes, and snippets.

  • 26 June 2014

    • Controls in Windows can now be spaced apart more naturally. Call w.SetSpaced(true) to opt in. Whether this will remain opt-in or whether the name will change is still unknown at this point.
    • There's a new function Layout() which provides high-level layout creation. The function was written by boppreh and details can be found here. Whether this function will stay in the main package or be moved to a subpackage is still unknown.
    • There is now Checkbox.SetChecked() to set the check state of a Checkbox programmatically.
  • 25 June 2014 Labels by default now align themselves relative to the control they are next to. There is a new function NewStandaloneLabel() which returns a label whose text is aligned to the top-left corner of the alloted space regardless.

  • 11 June 2014 I have decided to remove Mac OS X 10.6 support because it's only causing problems for building (and everyone el

@andlabs
andlabs / gist:740e742a28f41b81a7af
Last active August 29, 2015 14:03
Maybe we can salvage concurrent UI after all...

New proposal: rather than have methods do things, have methods create requests to do things.

At the top level, there is a channel ui.Do which accepts the results of setter methods:

ui.Do <- label.SetText("Hello")
ui.Do <- checkbox.SetChecked(true)

Getters, however, are a bit more work. Not only do we need to send a request, we need to get something back from it. So getters will require three lines:

ui

-- import "github.com/andlabs/ui/redo"

Usage

var Do = make(Doer)
# testmain
00000000 24 37 00 00 2e 74 65 78 74 2e 75 6e 6c 69 6b 65
00000016 6c 79 00 2e 72 64 61 74 61 24 7a 7a 7a 00 2e 72
00000032 64 61 74 61 24 2e 72 65 66 70 74 72 2e 5f 63 67
00000048 6f 65 78 70 5f 63 30 32 30 65 33 61 37 32 64 36
00000064 62 5f 77 69 6e 64 6f 77 43 6c 6f 73 69 6e 67 00
00000080 2e 72 64 61 74 61 24 2e 72 65 66 70 74 72 2e 5f
00000096 63 67 6f 65 78 70 5f 63 30 32 30 65 33 61 37 32
00000112 64 36 62 5f 77 69 6e 64 6f 77 52 65 73 69 7a 65
# 2 january 2015
# usage: ./e4jexamine summary file | awk -f fulllog.awk file
# TODO pass options to e4jexamine
# TODO check for errors
BEGIN {
# TODO make sure this is sufficient to alter ARGC/ARGV
file = ARGV[1]
ARGC = 1
}
{ print }
diff --git a/windows/alloc.c b/windows/alloc.c
index 1360e7f..15caf3c 100644
--- a/windows/alloc.c
+++ b/windows/alloc.c
@@ -1,89 +1,62 @@
// 4 december 2014
-#include "uipriv_windows.h"
+#include "uipriv_windows.hpp"
-// wrappers for allocator of choice
# 30 may 2016
from waflib import Utils
top = '.'
out = '_build'
def _platform(ctx):
plat = Utils.unversioned_sys_platform()
if plat == 'win32':
@andlabs
andlabs / libuibuild.md
Created May 31, 2016 23:17
libui Build System Requirements

libui Build System Requirements

Source Tree Layout

The libui source tree has a simple layout:

common/
    common sources and headers, .c and .h
darwin/
cmake
1 kainjow
13
1 sekrause
5
1 waddlesplash
4
1 rotseisermho
1 soloe
8