Ekspoint 2,122 Posted July 29, 2017 Можно ли как-то сделать нажатие кнопки принять или отклонить у всплывающего сообщения автоматом в питоне? Share this post Link to post Short link Share on other sites
soloviyko 12 #399441 Posted July 29, 2017 Можно ли как-то сделать нажатие кнопки принять или отклонить у всплывающего сообщения автоматом в питоне? from gui.shared import events, g_eventBus from gui.shared.utils.decorators import dialog from gui import DialogsInterface @dialog def my_showDialog(meta, callback): key = None if hasattr(meta, '_key'): key = meta._key if not key and hasattr(meta, '_meta') and meta._meta and hasattr(meta._meta, '_key'): key = meta._meta._key if d: LOG_NOTE('showDialog(key=%s, title=%s)' % (key, meta.getTitle())) if not key: key = meta.getTitle() if key == "Solo's Modpack Update ChangeLog": callback(False) else: g_eventBus.handleEvent(events.ShowDialogEvent(meta, callback)) return DialogsInterface.showDialog = my_showDialog EventDispatcher.loadHangar = EventDispatcher_loadHangar 1 Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #399456 Posted July 29, 2017 from gui.shared import events, g_eventBus from gui.shared.utils.decorators import dialog from gui import DialogsInterface @dialog def my_showDialog(meta, callback): key = None if hasattr(meta, '_key'): key = meta._key if not key and hasattr(meta, '_meta') and meta._meta and hasattr(meta._meta, '_key'): key = meta._meta._key if d: LOG_NOTE('showDialog(key=%s, title=%s)' % (key, meta.getTitle())) if not key: key = meta.getTitle() if key == "Solo's Modpack Update ChangeLog": callback(False) else: g_eventBus.handleEvent(events.ShowDialogEvent(meta, callback)) return DialogsInterface.showDialog = my_showDialog EventDispatcher.loadHangar = EventDispatcher_loadHangar я про центр уведомлений, а не диалог Share this post Link to post Short link Share on other sites