projects
/
app.Builder.js
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tools
[app.Builder.js]
/
Sample
/
DialogTemplateSelect.js
diff --git
a/Sample/DialogTemplateSelect.js
b/Sample/DialogTemplateSelect.js
index
3a038ee
..
486924e
100644
(file)
--- a/
Sample/DialogTemplateSelect.js
+++ b/
Sample/DialogTemplateSelect.js
@@
-28,12
+28,21
@@
DialogTemplateSelect=new XObject({
return node;
}
return node;
}
- opts.unshift(
'Just add Element')
+ opts.unshift(
{ path: '' , name :'Just add Element' });
this.get('combo.model').loadData(opts);
this.get('combo.model').loadData(opts);
-
+ this.get('combo').el.set_active(0);
this.el.show_all();
this.el.show_all();
- print(this.el.run());
+ this.el.run();
+ this.el.hide();
+ var ix = this.get('combo').el.get_active();
+ if (ix < 1 ) {
+ return node;
+ }
+
+
+ return pal.loadTemplate(opts[ix].path)
+
},
items : [
{
},
items : [
{
@@
-45,9
+54,6
@@
DialogTemplateSelect=new XObject({
{
xtype: Gtk.HBox,
pack : "pack_start,false,false,0",
{
xtype: Gtk.HBox,
pack : "pack_start,false,false,0",
- listeners : {
-
- },
items : [
{
xtype: Gtk.Label,
items : [
{
xtype: Gtk.Label,
@@
-60,28
+66,37
@@
DialogTemplateSelect=new XObject({
pack : "add",
init : function() {
XObject.prototype.init.call(this);
pack : "add",
init : function() {
XObject.prototype.init.call(this);
- this.el.add_attribute(this.items[0].el , 'markup', 1 );
+ this.el.add_attribute(this.items[0].el , 'markup', 1 );
},
items : [
{
xtype: Gtk.CellRendererText,
},
items : [
{
xtype: Gtk.CellRendererText,
- pack :
false
+ pack :
"pack_start"
},
{
xtype: Gtk.ListStore,
id : "model",
pack : "set_model",
},
{
xtype: Gtk.ListStore,
id : "model",
pack : "set_model",
+ init : function() {
+ XObject.prototype.init.call(this);
+ this.el.set_column_types ( 2, [
+ GObject.TYPE_STRING, // real key
+ GObject.TYPE_STRING // real type
+
+
+ ] );
+ },
loadData : function (data) {
this.el.clear();
var iter = new Gtk.TreeIter();
var el = this.el;
data.forEach(function(p) {
loadData : function (data) {
this.el.clear();
var iter = new Gtk.TreeIter();
var el = this.el;
data.forEach(function(p) {
-
+
el.append(iter);
el.append(iter);
- el.set_value(iter, 0,
p.xtype
);
- el.set_value(iter, 1,
p.desc
);
+ el.set_value(iter, 0,
''+ p.path
);
+ el.set_value(iter, 1,
''+ p.name
);
});
});
@@
-97,11
+112,6
@@
DialogTemplateSelect=new XObject({
{
xtype: Gtk.Button,
label : "OK",
{
xtype: Gtk.Button,
label : "OK",
- pack : "add_action_widget,1"
- },
- {
- xtype: Gtk.Button,
- label : "Just Add Element",
pack : "add_action_widget,0"
}
]
pack : "add_action_widget,0"
}
]