Skip to content

Andy-177/bubble-Lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bubble-Lib

A Python library that can pop up custom bubble notifications

注意(Notice)

bubble.py是可以导入的库,example.py是程序使用的一个示例

bubble.py is a library that can be imported, and example.py is an example used by the program.

使用教程(User Guide)

基础教程(Basic Guide)

1.导入库(Import library)

import tkinter as tk
from bubble import BubbleBox

2.创建窗体实例(Create a form instance)

import tkinter as tk
from bubble import BubbleBox

root = tk.Tk()
root.mainloop()

3.在实例中使用库(Using a library in an example)

import tkinter as tk
from bubble import BubbleBox

root = tk.Tk()
BubbleBox(window, title="标题(title)", text="消息内容(Message content)", color="#0088FF", height=50)
BubbleBox.enqueue_bubble(window, title="标题(title)", text="消息内容(Message content)", color="#0088FF", height=50)
root.mainloop()

自定义字体(Custom Font)

下面这些参数可以控制字体的大小、样式和使用的字体

The following parameters can control the font size, style, and the font used.

中文版(Chinese)

title_font:标题字体,字符串
title_size:标题大小,整数型
title_style:标题样式,字符串
text_font:消息内容字体,字符串
text_size:消息内容字体大小,整数型
text_style:消息样式,字符串

英文版(English)

title_font: Title font, string
title_size: Title size, integer
title_style: Title style, string
text_font: Message content font, string
text_size: Message content font size, integer
text_style: Message style, string

示例(Example)

无队列,同时弹出(No queue, pop up simultaneously)

BubbleBox(window, title="标题(title)", text="消息内容(Message content)", color="#0088FF", height=50)

有队列,按顺序弹出(There is a queue, popping out in order)

BubbleBox.enqueue_bubble(window, title="标题(title)", text="消息内容(Message content)", color="#0088FF", height=50)

提示(Tips)

1.加入队列使用在BubbleBox后面添加.enqueue_bubble,以将气泡窗添加到队列

  • To join the queue, use .enqueue_bubble after BubbleBox to add a bubble window to the queue.

2.第一个属性值是窗口实例的名称,比如创建了实例root = tk.TK,那么第一个属性要和实例名称重合,比如在这个例子里就是BubbleBox.enqueue_bubble(root, title="标题(title)", text="消息内容(Message content)", color="#0088FF", height=50)`

  • The first attribute value is the name of the window instance. For example, if you create an instance with root = tk.TK, then the first attribute should match the instance name. In this example, it would be BubbleBox.enqueue_bubble(root, title="Title (title)", text="Message content", color="#0088FF", height=50)

About

A Python library that can pop up custom bubble notifications

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages