changeset 83:5da3a9d257a3

Document the DWIB functions.
author Brian Smith <brian@dbsoft.org>
date Mon, 29 Apr 2013 17:04:59 -0500
parents ca31549d8a1c
children ea538711664a
files src/dwib/dwib.go
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dwib/dwib.go	Mon Apr 29 16:55:27 2013 -0500
+++ b/src/dwib/dwib.go	Mon Apr 29 17:04:59 2013 -0500
@@ -15,6 +15,7 @@
 
 type DWIB unsafe.Pointer
 
+// Loads a window with the specified name from an XML tree.
 func Load(handle DWIB, name string) dw.HWND {
    cname := C.CString(name);
    defer C.free(unsafe.Pointer(cname));
@@ -22,6 +23,7 @@
    return dw.HANDLE_TO_HWND(dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_load(unsafe.Pointer(handle), cname))));
 }
 
+// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index.
 func Load_at_index(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int {
    cname := C.CString(name);
    defer C.free(unsafe.Pointer(cname));
@@ -31,14 +33,17 @@
    return int(C.goib_load_at_index(unsafe.Pointer(handle), cname, cdataname, unsafe.Pointer(dw.HANDLE_TO_POINTER(window)), unsafe.Pointer(dw.HANDLE_TO_POINTER(box)), C.int(index)));
 }
 
+// Loads a part of a window layout specified by dataname with the specified window name from an XML tree and packs it into box at index.
 func LoadAtIndex(handle DWIB, name string, dataname string, window dw.HANDLE, box dw.HANDLE, index int) int {
     return Load_at_index(handle, name, dataname, window, box, index);
 }
 
+// Shows a window loaded with dwib.Load() using the stored settings. 
 func Show(handle dw.HANDLE) {
    C.goib_show(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle)));
 }
 
+// Loads an XML templates and returns a handle to the XML tree.
 func Open(filename string) DWIB {
    cfilename := C.CString(filename);
    defer C.free(unsafe.Pointer(cfilename));
@@ -46,10 +51,12 @@
    return DWIB(C.goib_open(cfilename));
 }
 
+// Closes a handle to an XML tree returned by dwib.Open*() and frees the memory associated with the tree.
 func Close(handle DWIB) {
    C.goib_close(unsafe.Pointer(handle));
 }
 
+// Update the location of the image root for locating image files.
 func Image_root_set(path string) int {
    cpath := C.CString(path);
    defer C.free(unsafe.Pointer(cpath));
@@ -57,10 +64,12 @@
    return int(C.goib_image_root_set(cpath));
 }
 
+// Update the location of the image root for locating image files.
 func ImageRootSet(path string) int {
     return Image_root_set(path);
 }
 
+// Update the locale used when identifying locating strings during creation.
 func Locale_set(loc string) int {
    cloc := C.CString(loc);
    defer C.free(unsafe.Pointer(cloc));
@@ -68,10 +77,12 @@
    return int(C.goib_locale_set(cloc));
 }
 
+// Update the locale used when identifying locating strings during creation.
 func LocaleSet(loc string) int {
     return Locale_set(loc);
 }
 
+// Gets the window handle for a named widget. 
 func Window_get_handle(handle dw.HANDLE, dataname string) dw.HANDLE {
    cdataname := C.CString(dataname);
    defer C.free(unsafe.Pointer(cdataname));
@@ -79,6 +90,7 @@
    return dw.POINTER_TO_HANDLE(dw.POINTER(C.goib_window_get_handle(unsafe.Pointer(dw.HANDLE_TO_POINTER(handle)), cdataname)));
 }
 
+// Gets the window handle for a named widget. 
 func GetHandle(handle dw.HANDLE, dataname string) dw.HANDLE {
     return Window_get_handle(handle, dataname);
 }