var plugin = require('topsin.gengui');

var gui = plugin.newGui(plugin.__dirname);

var data = [{
    name: "123",
    text: 123
}]
gui._extra = [{name:13, text:23}]
var r = gui.showForm({
    title: "注册账号",
    size: [600, 400],
    ui: function (self) {
        return [{
            type: 'ScrollArea',
            property: {
                widget_resizable: true,
                frame_shape: 'NoFrame',
                align: 'Top'
            },
            child: {
                type: 'VBoxLayout',
                property: {
                    margin: 2,
                    spacing: 20,
                    align: 'Top'
                },
                pack: {
                    stretch: 0
                },
                child: [{
                    type: "FormGridLayout",
                    property: {
                        columns: 1,
                        label_alignment: 'Top | Right',
                        margin: 10,
                        spacing: 20
                    },
                    pack: {
                        stretch: 0
                    },
                    child: [{
                        name: 'test',
                        type: 'ComboBox',
                        pack: {
                            label: "用户名"
                        },
                        property: {
                            enabled: true,
                            item_list: self._extra
                        }
                    }]
                }]
            }
        }]
    } ,
    data: {},
    includehide: false,
    buttons: [{
            stock: "ok",
            sensitive: true,
            command: function (data) {

            }
        },
        {
            stock: "cancel",
            sensitive: true,
            command: function (data) {

            }
        },
        {
            stock: "help",
            sensitive: true,
            command: function (data) {
                console.log(data);
            }
        }
    ],
});

console.log(r);