#!/usr/bin/python # # Copyright (c) 2009 Michal Hruby <michal.mhr at gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys import awn import gtk if __name__ == "__main__": awn.init(sys.argv[1:]) applet = awn.AppletSimple("python-test", awn.uid, awn.panel_id) applet.set_icon_name("gtk-yes") # applet icon applet.set_tooltip_text("Test python applet") # will be displayed on hover awn.embed_applet(applet) gtk.main()
win = gtk.AboutDialog() win.set_name(self.titles[self.media_button_type]) win.set_copyright('Copyright 2009 sharkbaitbobby') win.set_authors(['Randal Barlow <im.tehk at gmail.com>', 'Sharkbaitbobby <*****@*****.**>']) win.set_comments(self.desc[self.media_button_type]) win.set_license("This program is free software; you can redistribute it "+\ "and/or modify it under the terms of the GNU General Public License "+\ "as published by the Free Software Foundation; either version 2 of "+\ "the License, or (at your option) any later version. This program is "+\ "distributed in the hope that it will be useful, but WITHOUT ANY "+\ "WARRANTY; without even the implied warranty of MERCHANTABILITY or "+\ "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public "+\ "License for more details. You should have received a copy of the GNU "+\ "General Public License along with this program; if not, write to the "+\ "Free Software Foundation, Inc.,"+\ "51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.") win.set_wrap_license(True) win.set_logo_icon_name(self.icon_names[self.media_button_type]) win.set_website('http://wiki.awn-project.org/Media_Icons_Applet') win.set_website_label('wiki.awn-project.org') win.run() win.destroy() if __name__ == "__main__": awn.init(sys.argv[2:]) applet = App(awn.uid, awn.panel_id, sys.argv[1]) awn.embed_applet(applet) applet.show_all() gtk.main()
if str(self.msgs) == "0": self.SVGH_Face = rsvg.Handle( self.GetThemeFile('gmailread.svg', self.theme)) else: print str(self.msgs) self.SVGH_Face = rsvg.Handle( self.GetThemeFile('gmailunread.svg', self.theme)) def SetIconFromSurface(self, applet, surface): icon = self.GetPixbufFromSurface(surface) applet.set_icon(icon) def DrawTheme(self, applet): surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 50, 50) ctx = cairo.Context(surface) #ctx.scale(0.50,0.50) self.SVGH_Face.render_cairo(ctx) ctx.translate(50, 50) ctx.save() self.SetIconFromSurface(applet, surface) if __name__ == "__main__": awn.init(sys.argv[1:]) #print "%s %d %d" % (awn.uid, awn.orient, awn.height) applet = App(awn.uid, awn.orient, awn.height) awn.init_applet(applet) applet.show_all() gtk.main()
win.set_authors([ 'Randal Barlow <im.tehk at gmail.com>', 'Sharkbaitbobby <*****@*****.**>' ]) win.set_comments(self.desc[self.media_button_type]) win.set_license("This program is free software; you can redistribute it "+\ "and/or modify it under the terms of the GNU General Public License "+\ "as published by the Free Software Foundation; either version 2 of "+\ "the License, or (at your option) any later version. This program is "+\ "distributed in the hope that it will be useful, but WITHOUT ANY "+\ "WARRANTY; without even the implied warranty of MERCHANTABILITY or "+\ "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public "+\ "License for more details. You should have received a copy of the GNU "+\ "General Public License along with this program; if not, write to the "+\ "Free Software Foundation, Inc.,"+\ "51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.") win.set_wrap_license(True) win.set_logo_icon_name(self.icon_names[self.media_button_type]) win.set_website('http://wiki.awn-project.org/Media_Icons_Applet') win.set_website_label('wiki.awn-project.org') win.run() win.destroy() if __name__ == "__main__": awn.init(sys.argv[2:]) applet = App(awn.uid, awn.panel_id, sys.argv[1]) awn.embed_applet(applet) applet.show_all() gtk.main()