相关疑难解决方法(0)

我应该和Pygame一起使用什么gui工具包?

我正在制作一款游戏,需要能够在pygame表面中弹出gui元素.这个问题不是我想要的,因为wxPython绕过SDL表面而不是它内部.到目前为止,我只在这个问题空间中看过ocemp,pguGooeyPy.

  • Ocemp巨大而且看起来很狡猾.它提到了Python 2.3,我在快速浏览cvs repo时找到的最新文件是2岁.
  • 我无法让GooeyPy工作(虽然我没有努力;鸡蛋和Debian不是朋友)而v0.2最后更新于2009年2月.
  • 我一直在和pgu一起工作,但似乎没有得到维护(上次更新11/2009,原始维护者放弃了它),它开始显示它的年龄.它使用旧样式类并抛出字符串异常.

因此,我的问题是:我应该使用什么gui工具包来制作pygame应用程序中的可点击按钮?有没有积极的发展?

编辑,2011年9月

看起来PGU仍在维护中.最后一次提交是从4天前开始的.

python user-interface pygame widget

12
推荐指数
1
解决办法
6013
查看次数

在Tkinter中使用pygame功能

我想在我在Tkinter中制作的GUI中使用pygame(精灵图形)中的一些功能.我知道OcempGUI,但我更喜欢坚持使用Tkinter,只需使用pygame中的一些模块.类似但不完全相同.这有可能吗?什么是潜在的问题(事件循环)?

user-interface pygame tkinter

3
推荐指数
1
解决办法
4140
查看次数

如何为 pygame 创建这个 tkinter 菜单栏

我想在 pygame 中创建一个菜单栏,就像 tkinter 中的菜单栏一样。

from tkinter import *
def donothing():
   filewin = Toplevel(root)
   button = Button(filewin, text="Do nothing button")
   button.pack()

root = Tk()
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New", command=donothing)
filemenu.add_command(label="Open", command=donothing)
filemenu.add_command(label="Save", command=donothing)
filemenu.add_command(label="Save as...", command=donothing)
filemenu.add_command(label="Close", command=donothing)

filemenu.add_separator()

filemenu.add_command(label="Exit", command=root.quit)
menubar.add_cascade(label="File", menu=filemenu)
editmenu = Menu(menubar, tearoff=0)
editmenu.add_command(label="Undo", command=donothing)

editmenu.add_separator()

editmenu.add_command(label="Cut", command=donothing)
editmenu.add_command(label="Copy", command=donothing)
editmenu.add_command(label="Paste", command=donothing)
editmenu.add_command(label="Delete", command=donothing)
editmenu.add_command(label="Select All", command=donothing)

menubar.add_cascade(label="Edit", menu=editmenu)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="Help Index", command=donothing)
helpmenu.add_command(label="About...", command=donothing)
menubar.add_cascade(label="Help", menu=helpmenu)

root.config(menu=menubar)
root.mainloop() …
Run Code Online (Sandbox Code Playgroud)

pygame tkinter menubar python-3.x

3
推荐指数
1
解决办法
3740
查看次数

标签 统计

pygame ×3

tkinter ×2

user-interface ×2

menubar ×1

python ×1

python-3.x ×1

widget ×1