[英]wxHaskell : the window appears too tiny
我在haskell 中有一個小程序,使用wxhaskell。 它顯示一個帶有面板的窗口,其中包含一些圖紙。 問題是窗口縮小到非常小的尺寸,我必須用鼠標將其展開。
如何正確定義尺寸?
這是我的程序:
module Main where
import Graphics.UI.WX
import Graphics.UI.WXCore
main :: IO ()
main
= start hello
hello :: IO ()
hello = do
f <- frame [text := "HELLO!"]
sw <- panel f [ on paint := onpaint]
set f [clientSize := sz 300 300,
layout := fill $ widget sw]
return()
where
onpaint dc pnel = do
circle dc (pt 200 200) 20 [penKind := PenDash DashDot]
drawPoint dc (pt 200 200) []
謝謝你。
設置最小尺寸而不是客戶端尺寸
set f [ layout := minsize (sz 300 300) $ widget sw ]
為我工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.