我试图隐藏“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)
最佳答案
self.__app_indicator.set_status(AppIndicator3.IndicatorStatus.PASSIVE)
关于python - AppIndicator3.指示器: is there a way to hide/show it at runtime?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52724273/