小编Ern*_*kas的帖子

Gtk 3,python,appindicator,禁用标签附近的图标

我在python中写openweathermap网站appindicator,但我只需要指针中没有图标的文字标签.但是当我离开""然后给我看空图标.为什么,我只需要文字.在Ubuntu 12.04中,python-appindicator不需要图标如果离开""然后不加载空图标,但在ubuntu 14.04中留下空图标.如何禁用图标?有任何想法吗?

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import urllib2
import json 
import time
import datetime

from gi.repository import Gtk, Gdk, GLib, GObject
from gi.repository import AppIndicator3 as appindicator

class programa:

    def __init__(self):
    # Create Indicator with icon and label
        # If leave empty "" then load empty icon
        self.ind = appindicator.Indicator.new("Weather","",appindicator.IndicatorCategory.APPLICATION_STATUS)
        self.ind.set_status(appindicator.IndicatorStatus.ACTIVE) # 
        self.menu_structure()

    # Menu structure
    def menu_structure(self):
        refresh      = 720 # Refresh interval in seconds
        url          = urllib2.Request('http://api.openweathermap.org/data/2.5/weather?q=siauliai&units=metric') 
        openup       = urllib2.urlopen(url) …
Run Code Online (Sandbox Code Playgroud)

python gtk gobject glib appindicator

6
推荐指数
1
解决办法
1934
查看次数

标签 统计

appindicator ×1

glib ×1

gobject ×1

gtk ×1

python ×1