我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用gtk.AboutDialog()。
def action_about(self, *arg): dialog = gtk.AboutDialog() dialog.set_name(APP_TITLE) try : ver = subprocess.check_output(["dpkg-query", "--show", "--showformat='${Version}'", "nativecam"]) dialog.set_version(str(ver).strip("'")) except : dialog.set_version(APP_VERSION) try : data = open('/usr/share/doc/nativecam/copyright', 'r').read() dialog.set_license(data) except : dialog.set_license(APP_LICENCE) dialog.set_authors(APP_AUTHORS) dialog.set_comments(APP_COMMENTS) dialog.set_copyright(APP_COPYRIGHT) dialog.set_website(HOME_PAGE) dialog.run() dialog.destroy()
def on_about(self, widget, *args): """About Dialog What it says on the box """ print "About Gtk Info" logo = self.icon dialog = gtk.AboutDialog() dialog.set_name('Gtk Info') dialog.set_version(str(__version__)) dialog.set_authors([__maintainer__]) dialog.set_documenters([__maintainer__]) dialog.set_logo(logo) comment = 'A graphical interface for displaying system information' dialog.set_comments(comment) response = dialog.run() if response == -6: dialog.destroy() return
def show_about_dialog(self, widget): about_dialog = gtk.AboutDialog() about_dialog.set_destroy_with_parent(True) about_dialog.set_icon_name("Evaluator-Centric and Extensible Logger v%s" % (__version__)) about_dialog.set_name('ECEL') about_dialog.set_version(__version__) about_dialog.set_comments(("ECEL was developed as the result of a collaborative research project between the US Army Research Laboratory and the University of Texas at El Paso.")) about_dialog.run() about_dialog.destroy()
def showAbout(self, *args): dia = gtk.AboutDialog() dia.set_property('program-name', 'Micro:Pi') dia.set_property('version', '0.0.1') dia.set_property('copyright', '(c) Nathan Taylor 2016\nThe words "BBC" and "Micro:Bit" and the BBC Micro:Bit logo are all\ntrademarks of the BBC and I lay no claim to them.') dia.set_property('website', 'http://bottersnike.github.io/Micro-Pi') dia.set_property('comments', 'A pure python IDE for the BBC:MicroBit for C++') dia.set_property('license', open('data", "LICENSE').read()) dia.show() dia.run() dia.destroy() return False
def about(self, action=None): """Displays the About dialog.""" about = gtk.AboutDialog() about.set_program_name(NAME) about.set_version(VERSION) about.set_authors(AUTHORS) about.set_comments(COMMENTS) about.set_website(WEBSITE) gtk.about_dialog_set_url_hook(self.aboutLinkCallback) about.run() about.destroy()
def show_about_dialog(self, app_name, config_dir): """about dialog""" #open controller ini file self.ctrlr_ini = MameWahIni(os.path.join(config_dir, 'ctrlr', 'default.ini'), 'ctrlr') #create about dialog dlg = gtk.AboutDialog() dlg.set_name(app_name) dlg.set_version('\n%s "%s"' % (VERSION, VERSION_NAME)) dlg.set_logo(gtk.gdk.pixbuf_new_from_file( os.path.join(APP_PATH, 'pixmaps', 'wahcade-logo.png'))) gtk.about_dialog_set_url_hook(self.show_website, None) dlg.set_website('http:///www.anti-particle.com/wahcade.shtml') dlg.set_website_label('www.anti-particle.com/wahcade') dlg.set_authors([ 'Andy Balcombe', 'sairuk', 'Bug Reports and Patches:', ' Sylvain Fauveau', ' Robbforce', ' Jim Merullo', ' SeTTleR', ' Mike Crawford', ' Mike Schwartz', ' Nellistc', ' Captbaritone', ' Delphipool', ' 3NF', ' Zerodiv', ' Natrix', ' Bonzo', ' Battlecat', ' Krisbee', ' Buks', ' KillsTheWeak', ' Martin Kalitis', ' Zerojay', ' Dave Baer', ' Spudgunman', ' RomKnight', ' Jason Carter', ' Zombie', ' Pinball Wizard', ' hamelg', ' 3vi1', ' Vítor Baptista', ' Enrico Magrella', 'zagadka', ' and anyone I\'ve forgotten...', '', 'Translations:', ' de: SeTTleR', ' es: Nicolás Álvarez', ' fr: Sylvain Faveau', ' it: Diego Pierotto', ' sv: Daniel Nylander', '', 'bdist_debian.py: Gene Cash', '', ]) dlg.set_artists(['Andy Balcombe', 'Buks', 'Battlecat']) dlg.set_copyright('%s 2005-2010 Andy Balcombe' % ( unichr(169)).encode("utf-8")) dlg.set_comments('Thanks to:\nMinWah and also the Mame / xMame team') dlg.set_translator_credits(_('translator-credits')) dlg.set_license(open(os.path.join(APP_PATH, 'doc', 'COPYING')).read()) dlg.connect('key_press_event', self.on_dlgAbout_key_press) dlg.run() dlg.hide()
def on_about(self,widget): about = gtk.AboutDialog() about.set_authors(AUTHORS) about.set_program_name(NAME) about.set_copyright(COPYRIGHT) about.set_website(WEBSITE) about.run() about.destroy()