开发者

How to create a method in a GObject subclass in JS/Seed

I have GObject subclass defined.

BrowserToolbar = new GType({
    parent: Gtk.HBox.type,
    name: "BrowserToolbar",

    init: function (){
    }
});

I have defined new function abc using the same syntax as for init.

BrowserToolbar = new GType({
    parent: Gtk.HBox.type,
    name: "Browser开发者_StackOverflow中文版Toolbar",

    init: function (){
    }

    abc: function (){
    }
});

But I am not able to call it, it is "undefined". What is wrong?

var tb = new BrowserToolbar();
tb.abc(); // undefined -> error

Thanks


Found it: http://git.gnome.org/browse/seed-examples/tree/browser/TabbedBrowser.js

 init: function ()
 {
    this.close_tab = function (tab) {}
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜