swamp_agr (swamp_agr) wrote,
swamp_agr
swamp_agr

Graphics.UI.WXCore.Draw или HTk.Widgets.Canvas

import Graphics.UI.WX

main = do start hello

hello :: IO ()
hello = do 
  f1 <- frameFixed [text := "test1"]
  p <- panel f1 [on paint := drawItems]
           
  set f1 [layout := minsize (sz 300 300) $ widget p]
           
drawItems dc viewArea = 
  do set dc [brushColor := green, brushKind := BrushSolid]
     drawLine dc [(Point 250 250), (Point 200 200)]

drawLine dc pt = line dc (head pt) (last pt) []

Или так:
import HTk.Toplevel.HTk
import HTk.Kernel.Core

main = do main <- initHTK [text "Sample", size (300 300)]
          f <- newFrame main []
          pack f []
          canv <- newCanvas [size (300, 300)]
          pack canv [Side AtTop, Fill Both]
          createLine canv [coord [(250, 250), (200, 200)], outlinewidth (mm 1), filling "green"]
Tags: gui, haskell
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments