我是靠谱客的博主 忧虑手链,这篇文章主要介绍python-gtk-3-tutorial(1) Getting Started,现在分享给大家,希望可以做个参考。

Getting Started

File:simple_example.py
#!/usr/bin/python
from gi.repository import Gtk

win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()
Let me explain:  
(1) from gi.repository import Gtk
To import Gtk class from gi.repository
(2) win = Gtk.Window()
To create a empty windows object.
(3) win.connect("delete-event", Gtk.main_quit)
To connect the window's delete event.
(4) win.show_all()
we display the window
Gtk.main()
we start the GTK+ processing loop which we quit when the window is closed (see line 5).

最后

以上就是忧虑手链最近收集整理的关于python-gtk-3-tutorial(1) Getting Started的全部内容,更多相关python-gtk-3-tutorial(1)内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(127)

评论列表共有 0 条评论

立即
投稿
返回
顶部