Permalink
Browse files

[wxhaskell-from-cvs @ 2003-07-21 00:06:37 by dleijen]

New license and sample.

darcs-hash:20030721000638-deb31-2c3cbffecd9b34db2eed1fb622c5163146a3126b.gz
  • Loading branch information...
1 parent 2f8e020 commit f68541d9e522c2423b42c0db358762857a9c55b6 dleijen committed Jul 21, 2003
Showing with 44 additions and 0 deletions.
  1. +14 −0 license.txt
  2. +30 −0 samples/wx/Paint.hs
View
@@ -0,0 +1,14 @@
+The wxHaskell libraries are distributed under the wxWindows library license.
+The documentation is subject to the wxWindows documentation license.
+
+See "http://www.wxwindows.org/newlicen.htm" for the legal description of the license.
+
+The wxWindows library licence is essentially the L-GPL (Library General Public Licence),
+with an exception stating that derived works in binary form may be distributed on the
+user's own terms. This means that it is possible to create commercial software with this
+library without paying royalties or disclosing source code. This is a solution that satisfies
+those who wish to produce GPL'ed software using wxHaskell, and also those producing proprietary software.
+
+This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the wxWindows library license for more details.
View
@@ -0,0 +1,30 @@
+module Main where
+
+import Graphics.UI.WXH
+import Graphics.UI.WX
+
+main :: IO ()
+main
+ = start gui
+
+gui :: IO ()
+gui
+ = do f <- frame [text := "Paint demo"]
+ sw <- scrolledWindow f [on paint := onpaint, virtualSize := sz 500 500, scrollRate := sz 10 10]
+ set f [clientSize := sz 150 150, layout := widget sw]
+ return ()
+ where
+ onpaint dc viewRect updateAreas
+ = do circle dc (pt 200 200) 20 [penKind := PenDash DashDot]
+ arc dc (pt 100 100) 20 90 230 [color := red, penWidth :~ (+1), penKind := PenSolid]
+ ellipticArc dc (rect (pt 20 20) (sz 60 30)) 90 230 [color := blue, penWidth :~ (*2)]
+ c <- get dc color
+ -- set dc [font := fontDefault{ fontFace = "Courier New", fontSize = 16, fontWeight = WeightBold }]
+ set dc [fontFace := "Courier New", fontSize := 16, fontWeight := WeightBold ]
+ drawText dc (show c) (pt 50 50) []
+ rotatedText dc "rotated text" (pt 80 160) 45 [textColor := green]
+
+
+
+
+

0 comments on commit f68541d

Please sign in to comment.