1

I am developing a program that generates a notification upon completion. It is clickable and I would like to exaggerate this by underlining or bolding "Click here" in the notification. Is this possible? If it's not a feature in win10toast, is there another module I could use?

Daniel Walker
  • 6,380
  • 5
  • 22
  • 45
willkang7
  • 78
  • 6

1 Answers1

1

try:

from win10toast import ToastNotifier

def return_with_underline(x):
    lst1 = []
    for letter in x:
        if letter != ' ':
            lst1.append(letter)
            lst1.append('\u0332')
        else:
            lst1.append(letter)
    return '{:s}'.format(''.join(lst1))

toaster = ToastNotifier()

toaster.show_toast(return_with_underline('Click Here!'), "Hi", icon_path=None, duration=5)

This is not perfect (does not work with spaces), but you can use other Unicode characters too, instead of \u03232

Got this from here (they are talking about plain strings but it works here too):

Python: String formatter to get underlined headline

KetZoomer
  • 2,701
  • 3
  • 15
  • 43