Tag: tk

如何为bash脚本创build一个GUI?

我想为我的脚本做一些graphics化的对话框,但不知道如何。 我听到有关GTK-Server或类似的东西。 如果有人知道如何将Bash与tcl / tk连接,我也会很满意。 请不要发布类似“改为C ++”的东西,因为我的项目必须是Bash中的脚本; 没有其他的select。 有任何想法吗? 编辑:谢谢你的答案,但我不想在控制台中的颜色“graphics”,但我可以移动,最小化等graphics窗口我会testingxmessage ,但我不认为这将是我正在寻找对于。 编辑2:我不想做一个简单的对话框,如是/否,但一些像进度条和button的界面,就像一个游戏。

无法在Windows上使用cygwin启动git gui

我曾经在我的cygwin控制台启动git gui没有任何问题,但自从我更新cygwin我有以下错误信息: $ git gui Application initialization failed: no display name and no $DISPLAY environment variable Error in startup script: invalid command name "tk_messageBox" while executing "tk_messageBox -icon error -type ok -title "git-gui: fatal error" -message $err" invoked from within "if {[catch {package require Tcl 8.4} err] || [catch {package require Tk 8.4} err] } […]

错误“.onLoad在loadNamespace()for'tcltk'失败

我有一个关于如何有效地将任何types的外部包加载到R中的一般性问题。我发现详细说明这些信息的许多来源是不够的,但是我将不提及这些相应的URL。 我已经成功地将外部包加载到R之前,但我有困难加载fgui包。 在我的具体情况下,我不能将库fgui加载到R Studio中。 首先,我直接从CRAN下载命令: install.packages("fgui", lib="~/Documents/R_dir") 这对我来说很好。 我的工作目录设置为〜/ Documents / R_dir 我使用的下一个命令是: library("fgui", lib.loc="~/Documents/R_dir") 我得到的错误是: Error : .onLoad failed in loadNamespace() for 'tcltk', details: call: dyn.load(file, DLLpath = DLLpath, …) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so': dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /opt/X11/lib/libX11.6.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so Reason: image not found Error: package or namespace […]

绘制代码来移动椭圆

我正在为一所大学的Python跳棋游戏工作。 我使用tk绘制了棋盘,但似乎无法实现棋子的移动function。 如果有人在我的代码中看到任何错误,或者可以提供帮助,我将不胜感激。 这是完整的来源。 提前致谢。 我知道这会吸引棋子。 我不知道如何重绘这些作品,而不删除其他作品。 我在网上查看移动function,并尝试了简单的testing工作,但我还没有能够在我的代码中使用它。 我知道recursion,但是,我需要基本的function来工作,即实际上移动一块在屏幕上,然后再执行其他function。 lst2 = [] #counter variable i=0 #board variable is what stores the X/O/- values. # It's a 2D list. We iterate over it, looking to see # if there is a value that is X or O. If so, we draw # text to the screen […]