Created
May 28, 2011 18:43
-
-
Save yurenju/997116 to your computer and use it in GitHub Desktop.
PanelButton
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const St = imports.gi.St; | |
const PanelMenu = imports.ui.panelMenu; | |
const Main = imports.ui.main; | |
function HelloPanelButton() { | |
this._init(); | |
} | |
HelloPanelButton.prototype = { | |
__proto__: PanelMenu.Button.prototype, | |
_init: function() { | |
PanelMenu.Button.prototype._init.call(this, 0.0); | |
let btn = new St.Label({text: 'hello'}); | |
this.actor.set_child(btn); | |
}, | |
}; | |
function main() { | |
let hbtn = new HelloPanelButton(); | |
Main.panel._leftBox.add(hbtn.actor); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment