From f4f77134fb5cf4fe53a598e7b70a77cc86095bf2 Mon Sep 17 00:00:00 2001 From: Rick Smith Date: Fri, 14 Aug 2015 10:11:44 -0600 Subject: [PATCH 1/2] Fix typo in docs --- wde.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wde.go b/wde.go index 98c7002..bc0c675 100644 --- a/wde.go +++ b/wde.go @@ -73,7 +73,7 @@ will register a backend with go.wde, allowing you to call wde.Run(), wde.Stop() and wde.NewWindow() without referring to the backend explicitly. -If you pupt the registration import in a separate file filtered for +If you put the registration import in a separate file filtered for the correct platform, your project will work on all three major platforms without configuration. From 517031c489a538d2a081436652b409f5be2f3440 Mon Sep 17 00:00:00 2001 From: Rick Smith Date: Fri, 14 Aug 2015 10:49:47 -0600 Subject: [PATCH 2/2] Add to documentation how to import init to auto import correct backend --- wde.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wde.go b/wde.go index bc0c675..36558d3 100644 --- a/wde.go +++ b/wde.go @@ -55,8 +55,17 @@ recommended that your main function look like the the code below. wde.Run() will return when wde.Stop() is called. -For this to work, you must import one of the go.wde backends. For -instance, +For this to work, you must import one of the go.wde backends. To +automatically import the correct backend, add this to your imports: + + import _ "github.com/skelterjohn/go.wde/init" + +This will register a backend with go.wde, allowing you to call +wde.Run(), wde.Stop() and wde.NewWindow() without referring to the +backend explicitly. + +If you would like to disable a backend, you must import all + of the go.wde backends except the disabled ones. For instance, import _ "github.com/skelterjohn/go.wde/xgb" @@ -69,13 +78,9 @@ or import _ "github.com/skelterjohn/go.wde/cocoa" -will register a backend with go.wde, allowing you to call -wde.Run(), wde.Stop() and wde.NewWindow() without referring to the -backend explicitly. - If you put the registration import in a separate file filtered for -the correct platform, your project will work on all three major -platforms without configuration. +the correct platform, your project will only work on the imported +platforms. That is, if you import go.wde/xgb in a file named "wde_linux.go", go.wde/win in a file named "wde_windows.go" and go.wde/cocoa in a