【发布时间】:2019-07-23 10:08:56
【问题描述】:
我开始从事一些 GUI 编程并决定使用 ltk。 Ltk 代表“lisp 工具包”,它在基本的 tcl / tk 命令之上提供了一个 lispy 语法层。在某种程度上,它很像 Python 的 Tkinter。
然而,我发现,将两个画布放在一个框架中并让其中一个在两个方向上展开时。该画布不会扩展到屏幕的中点。
为了说明我的意思,我将提供一些图片。 这是创建后的窗口。
展开后是这样的:
我现在正试图摆脱浅灰色区域,但无论我做什么,左侧画布似乎都不想进入屏幕的右半部分。
我在 linux mint 上运行它,但这并不重要。我使用的是 2019 年 2 月 2 日发布的 ltk 版本。我试过弄乱当前的关键字参数,但没有任何工作。
这是导致这些屏幕的代码。
(in-package :ltk)
(defun scribble ()
(with-ltk ()
(let* ((frame (make-instance 'frame))
(canvas (make-instance 'canvas
:master frame
:background "white"))
(color-panel (make-instance 'canvas
:master frame
:width 400
:background "grey")))
(pack frame
:expand t
:fill :both)
(pack color-panel
:side :right
:expand t
:fill :y
:anchor :e)
(pack canvas
:side :left
:expand t
:fill :both
:anchor :w))))
;; To run the code, just run this function (in REPL or otherwise)
(scribble)
【问题讨论】:
-
不,我没有,但可能值得一看。也许比
pack@Ehvince 更容易理解。
标签: common-lisp tk