var win = XN.xnew({
xtype : Gtk.Window,
type: Gtk.WindowType.TOPLEVEL,
listeners : {
'delete-event' : function (widget, event) {
return false;
},
destroy : function (widget) {
Gtk.main_quit();
}
},
set : {
set_border_width : [ 10 ],
resize : [300, 300],
show_all : []
},
items : [
{
xtype : Gtk.VBox,
items : [
{
xtype : Gtk.TreeView,
onRender : function()
{
this.column = XN.xnew({
xtype : Gtk.TreeViewColumn,
items : [
{
xtype : Gtk.CellRendererText
}
]
});
this.column.add_attribute(this.column.items[0], "text", 0);
this.append_column(this.column);
this.set_model( XN.xnew( {
xtype : Gtk.TreeStore,
onRender : function() {
this.set_column_types ( 1, [GObject.TYPE_INT] );
this.iter = new Gtk.TreeIter();
this.append(this.iter);
this.set_value(this.iter, 0, [GObject.TYPE_INT, 3]);
this.append(this.iter);
this.set_value(this.iter, 0, [GObject.TYPE_INT, 2]);
this.append(this.iter);
this.set_value(this.iter, 0, [GObject.TYPE_INT, 9]);
}
}));
}
}
]
}
]
});
createDelegate = function(method, obj, args, appendArgs){
return function() {
var callArgs = args || arguments;
if(appendArgs === true){
callArgs = Array.prototype.slice.call(arguments, 0);
callArgs = callArgs.concat(args);
}else if(typeof appendArgs == "number"){
callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
var applyArgs = [appendArgs, 0].concat(args); // create method call params
Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
}
return method.apply(obj || window, callArgs);
};
};
xnew = function(o)
{
var ret = o.self || new o.xtype(o);
o.items = o.items || [];
//Seed.print(o.pack.length);
// packing
var addm = typeof(ret['add']) == 'undefined' ? 'pack_start' : 'add';
ret.items = [];
for( var i =0; i < o.items.length;i++) {
ret.items[i] = xnew(o.items[i]);
ret[ o.items.length == 1 ? addm : 'pack_start'](ret.items[i]);
ret.items[i].xparent = ret;
}
o.set = o.set || {};
for (var i in o.set) {
ret[i].apply(ret, o.set[i]);
}
o.listeners = o.listeners || {};
for (var i in o.listeners) {
var _li = createDelegate(o.listeners[i],ret);
Seed.print(typeof(_li));
ret.signal[i].connect(_li);
}
// apply functions..
for(var i in o) {
if (typeof(ret[i]) == 'undefined') {
ret[i] = o[i];
}
}
if (ret.onRender) {
ret.onRender.call(ret);
}
return ret;
}
/**
* usage
* gtranslate('hello', 'en', 'es', function (res) {
* if (typeof(res) == 'object') { return; } // failure
* console.log(res); // success...
* });
*/
function gtranslate(str, src, dest, cb)
{
var x = new Roo.data.ScriptTagProxy({
url: 'http://ajax.googleapis.com/ajax/services/language/translate',
callbackParam : 'callback'
});
x.load(
{
v: '1.0',
q : str,
langpair : src + '|' +dest,
}, // end params.
{ // reader
readRecords : function (o) {
if (!o.responseData) {
return o;
}
return o.responseData.translatedText;
}
},
function (result) {
cb(result);
},
this,
[]
);
}
[UPDATE] = Roo's build scrips now use gnome seed.
As I mentioned before, I've been busy getting the Ext Fork usable. still not quite there, but it's beginning to take shape.
The fork I did of dmdscript (initially for gtk bindings) is being used as the core for all the build tools I'm working on for RooJS, so I though in honour of it's main use, I'll rename it rooscript (as it's a lot easier to google for than gtkDjs or whatever I came up with before..)
So here's a quick howto for building and testing the kit so far.
First install gdc and subversion (I prefer it to dmd, as it's easier and quicker to set up and use)
#apt-get install gdc
#apt-get install subversion
decide where you want your code checked out to.
#cd /usr/src
#svn co http://www.akbkhome.com/svn/rooscript
#cd rooscript
#sh roo.lite.gdc.sh
you should hopefully now have /usr/bin/roolite
#cd /usr/src
#svn co http://www.akbkhome.com/svn/roojs1
#cd roojs1
#roolite ../rooscript/examples/jstoolkit2/run.js \
-- Array.js Date.js Function.js Number.js Roo.js String.js \
-r Roo -t=../rooscript/examples/jstoolkit2/templates/jsdoc/ \
-d=docs/
#roolite buildSDK/bundle_build.js -L../rooscript/examples/jstoolkit2
I've started looking at forking ExtJS, after some considerable thought, I'm pretty close to the concluding that forking ExtJS is really option left, to retain the investment I've already made in it..
So, as I have a Zip file of 1.1.1 and it explicitly says that the Javascript code is Licensed under LGPL, (not ifs/ no but's) - I'm slowly putting the code into my subversion repo under www.akkbkhome.com/svn/extjs1 (*I'm looking at extjs1.1.1 as I have been using it and tend to prefer it, but there is nothing in the discusion below that precludes anyone helping/leadingwith the last extjs2 version that was released)
Now if this actually becomes a full fork (most forks fail BTW), It will need a bit of work, so If anyone is interested in helping out. I've no idea where this could go. But this fork ain't changing the license no-more...
I think there's quite a few things to do here... so Ideas or contributions.. -- feel free to email me, or just comment on this post. - At worst, it could form the brainstorming for anyone else actually doing this. (If you want to comment on if/should this be done - do it on my previous post, otherwise I will delete the comment)
I have to admitafter some reflection to being pretty pissed at this change, ExtJs was useful in a number of ways, other than being a reasonably well written, the forums where search-able, so you occasionally found fixes to issues that you where having. The doc's where not to bad. etc.
But basically I've committed 1000's of hours of time to learning, and writing huge codebases that depend on ExtJS, under the basic premise that it was availably for Free, with the only Caveat that If I modified ExtJS, then I would have to give back those changes. "Quid Quo-pro" as they say.
The Change to GPL has altered that equation in such a radical way that If this was not a 'software' product, and was something physical. you would be down at the consumer council, and filing a class action against Jack for things like Breach of trust, financial gain by deception etc.And filing claims for the loss of your time, and the cost of replacing his library..
I have seen postings that appear to claim Jack plan's to 'send notice' to people using a fork, but as far as I can see, he released the Javascript code as LGPL, and from every reading I've seen of that, I have the absolute right to distribute the Javascript code, along with any modifications. - This is the purpose of the license!!! - so by claiming otherwise he is not honoring his own license, not a good omen for the future of ExtJs even under GPL!
I'm floating this, as a plan... - shout if you are interested/ have some ideas..?? - (or you can find real technical flaws - not FUD flaws please).