projects
/
app.Builder.js
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3a0630
)
Sample/Window.js
author
Alan Knowles
<alan@akkbhome.com>
Wed, 1 Dec 2010 13:56:16 +0000
(21:56 +0800)
committer
Alan Knowles
<alan@akkbhome.com>
Wed, 1 Dec 2010 13:56:16 +0000
(21:56 +0800)
Sample/Window.js
patch
|
blob
|
history
diff --git
a/Sample/Window.js
b/Sample/Window.js
index
00a7cfe
..
9eee5c5
100644
(file)
--- a/
Sample/Window.js
+++ b/
Sample/Window.js
@@
-3303,7
+3303,8
@@
Window=new XObject({
*/
},
viewAdd : function(item, par)
*/
},
viewAdd : function(item, par)
- {
+ {
+
// does something similar to xobject..
item.pack = (typeof(item.pack) == 'undefined') ? 'add' : item.pack;
// does something similar to xobject..
item.pack = (typeof(item.pack) == 'undefined') ? 'add' : item.pack;
@@
-3311,13
+3312,19
@@
Window=new XObject({
return;
}
print("CREATE: " + item['|xns'] + '.' + item['xtype']);
return;
}
print("CREATE: " + item['|xns'] + '.' + item['xtype']);
+
+
var type = item['|xns'] + '.' + item['xtype'];
if (item['|xns'] == 'GtkClutter') { // we can not add this yet!
return false;
}
var type = item['|xns'] + '.' + item['xtype'];
if (item['|xns'] == 'GtkClutter') { // we can not add this yet!
return false;
}
+
var ns = imports.gi[item['|xns']];
var ns = imports.gi[item['|xns']];
- var ctr = ns[item['xtype']];
+ var ctr = ns[item['xtype']]; // why are we using array here..?
+
+
+
var ctr_args = { };
for(var k in item) {
var kv = item[k];
var ctr_args = { };
for(var k in item) {
var kv = item[k];
@@
-3341,7
+3348,7
@@
Window=new XObject({
if (kv.match(new RegExp('function'))) {
continue;
}
if (kv.match(new RegExp('function'))) {
continue;
}
-
print("WASL " + k + '=' + kv);
+ print("WASL " + k + '=' + kv);
try {
eval( 'kv = ' + kv);
} catch(e) { continue; }
try {
eval( 'kv = ' + kv);
} catch(e) { continue; }
@@
-3361,7
+3368,15
@@
Window=new XObject({
ctr_args[k] = kv;
}
ctr_args[k] = kv;
}
+ var altctr = XObject.baseXObject({ xtype: ctr} );
+ if (!item.pack && altctr) {
+ // try XObject.
+ item.pack = altctr.prototype.pack;
+
+
+
+ }
var el = new ctr(ctr_args);
var el = new ctr(ctr_args);