AppIndicator3.Indicator: есть ли способ скрыть / показать его во время выполнения? - PullRequest
0 голосов
/ 09 октября 2018

Я пытаюсь скрыть `AppIndicator3.Indicator`` один раз, но пока все мои попытки провалились.

Пока я пытался просто установить экземпляр на None в надежде, чтосборщик мусора удалил бы его, и я попытался установить меню на None.

Вот как я его показываю:

def __show_app_indicator(self) -> None:
    if AppIndicator3:
        icon_theme = Gtk.IconTheme.get_default()
        icon_name = icon_theme.lookup_icon('weather-showers-symbolic', 16, 0).get_filename()
        self.__app_indicator: AppIndicator3.Indicator = AppIndicator3.Indicator \
            .new(APP_ID, icon_name, AppIndicator3.IndicatorCategory.HARDWARE)
        self.__app_indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
        self.__app_indicator.set_menu(self.__app_indicator_menu)

1 Ответ

0 голосов
/ 09 октября 2018
...