【Appindicator正面】最是人间留不住,朱颜辞镜花辞树。这篇文章主要讲述Appindicator正面相关的知识,希望能为你提供帮助。
snippet to show appindicator problem
- #!/usr/bin/env python
- import gobject
- import pygtk
- pygtk.require( '2.0')
- import gtk
- import appindicator
- import sys
- class AppIndicatorExample:
- def __init__( self) :
- self.ind = appindicator.Indicator ( " example-simple-client" ,
- " indicator-messages" ,
- appindicator.CATEGORY_APPLICATION_STATUS)
- self.ind.set_attention_icon ( " indicator-messages-new" )
- self.ind.set_icon( " distributor-logo" )
- self.inicialice( )
- def inicialice( self) :
- # create a menu
- self.menu = gtk.Menu( )
- # create items for the menu - labels, checkboxes, radio buttons and images
- # are supported:
- item = gtk.MenuItem( " Regular Menu Item" )
- item.show( )
- self.menu.append( item)
- check = gtk.CheckMenuItem( " Check Menu Item" )
- check.show( )
- self.menu.append( check)
- radio = gtk.RadioMenuItem( None, " Radio Menu Item" )
- radio.show( )
- self.menu.append( radio)
- image = gtk.ImageMenuItem( gtk.STOCK_QUIT)
- image.connect( " activate" , self.quit)
- image.show( )
- self.menu.append( image)
- self.menu.show( )
- self.ind.set_menu( self.menu)
- def show( self) :
- self.ind.set_status ( appindicator.STATUS_ACTIVE)
- def quit( self, widget=None, data=https://www.songbingjia.com/android/None) :
- self.ind.set_status( appindicator.STATUS_PASSIVE)
- self.menu.destroy( )
- gtk.main_quit( )
- def quit_in_5( indicator) :
- indicator.quit( )
- print " Executing quit"
- return 0
- if __name__ == " __main__" :
- indicator = AppIndicatorExample( )
- indicator.show( )
- # this timeout help us to reproduce the problem. It gives you 5 seconds
- # to display the indator menu making clic on the icon
- gobject.timeout_add( 5000, quit_in_5, indicator)
- gtk.main( )
推荐阅读
- .NET-C#-Interop-Excel-Utility/Wrapper类
- 使用AppleScript重新启动Django开发服务器
- 用于检测访问者是否在android设备上的函数
- AppStore从网站自动检测应用程序
- JPA NonflushableQueryRapper公司
- Android(将文本绘制为动态大小的位图)
- 在Android应用程序中加载现有电子邮件并修改其内容
- 加载应用程序后刷新UIAppearance
- HTML中的Favicon和Apple图标