开发者

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

开发者 https://www.devze.com 2023-03-22 13:26 出处:网络
I have GObject subclass defined. BrowserToolbar = new GType({ parent: Gtk.HBox.type, name: \"BrowserToolbar\",

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

精彩评论

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