如何使用Gtk.Application Gtk + 3 Glade Python更改/切换窗口? [英] How to change/switch windows using Gtk.Application Gtk+3 Glade Python?

查看:347
本文介绍了如何使用Gtk.Application Gtk + 3 Glade Python更改/切换窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了本教程 -
https: //python-gtk-3-tutorial.readthedocs.io/en/latest/application.html

I read this tutorial- https://python-gtk-3-tutorial.readthedocs.io/en/latest/application.html

它在第一段说 -


Gtk.Application包含许多重复性任务,即现代
应用程序需要处理多个实例,D-Bus
激活,打开文件,命令行解析,启动/关闭
菜单管理窗口管理等等。 b $ b

Gtk.Application encompasses many repetitive tasks that a modern application needs such as handling multiple instances, D-Bus activation, opening files, command line parsing, startup/shutdown, menu management, window management, and more.

如何使用Gtk.Application来启动/关闭,窗口管理和菜单管理?我找不到任何教程,示例或API文档。任何人都可以建议如何做到这一点?我正在使用Python 2.7.14和Pygobject(pygi-aio-3.24.1_rev1-setup)。感谢提前。

How do I do startup/shutdown, window management and menu management using Gtk.Application? I could not find any tutorials, examples or API documentation. Can anyone suggest how to do this? I am using Python 2.7.14 and Pygobject(pygi-aio-3.24.1_rev1-setup). Thank in Advance.

推荐答案

启动/关闭意味着启动或关闭应用程序。这使得通过双击通常在所述应用中使用的文件来启动您的应用变得更容易。 简单示例

startup/shutdown means to start or shut down the app. Which makes it easier to launch your app by double clicking a file that would normally be used in said app. Simple example

菜单管理这可以为您的GtkApplication中的所有窗口创建全局相同的菜单。它也可以使Mac菜单更容易。由于它看起来像你使用Windows,这不会真的帮助你。 文档

menu management This can create a global, identical menu for all windows within your GtkApplication. It can also make Mac menus easier. Since it looks like you are using Windows, this won't really help you. docs

窗口管理您可以控制和监视哪些窗口已打开或正在使用,然后在您的应用下次启动时重新打开这些窗口。 文档

window management You can control and monitor which windows are opened or being used, and then reopen those windows next time your app is launched. docs

其中一些功能可用于其他目的,但大多数GtkApplication功能仅适用于高级编程要求。

Some of these features can be used for other purposes, but most GtkApplication features only are useful for advanced programming requirements.

这篇关于如何使用Gtk.Application Gtk + 3 Glade Python更改/切换窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆