Jump to content
Korean Random
Ekspoint

всплывающее сообщение

Recommended Posts

Можно ли как-то сделать нажатие кнопки принять или отклонить у всплывающего сообщения автоматом в питоне?

Share this post


Link to post

Short link
Share on other sites

Можно ли как-то сделать нажатие кнопки принять или отклонить у всплывающего сообщения автоматом в питоне?

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

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
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
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...