wxhaskell

cabal install wx Missing C library

穿精又带淫゛_ 提交于 2020-02-03 08:56:12
问题 Env: OS: feodra 16 haskell-platform wxGTK-devel ghc 7.0.4 I am trying to install wxHaskell with cabal install wx Then these errors are given. Missing dependencies on foreign libraries: * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8, wx_gtk2u_core-2.8, wx_gtk2u_adv-2.8, wx_gtk2u_html-2.8, wx_gtk2u_qa-2.8, wx_gtk2u_xrc-2.8, wx_gtk2u_aui-2.8, wx_gtk2u_richtext-2.8, wx_gtk2u_media-2.8, wx_gtk2u_stc-2.8, wx_gtk2u_gl-2.8 And these libraries actually exist in /usr/lib I type

cabal install wx Missing C library

老子叫甜甜 提交于 2020-02-03 08:53:12
问题 Env: OS: feodra 16 haskell-platform wxGTK-devel ghc 7.0.4 I am trying to install wxHaskell with cabal install wx Then these errors are given. Missing dependencies on foreign libraries: * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8, wx_gtk2u_core-2.8, wx_gtk2u_adv-2.8, wx_gtk2u_html-2.8, wx_gtk2u_qa-2.8, wx_gtk2u_xrc-2.8, wx_gtk2u_aui-2.8, wx_gtk2u_richtext-2.8, wx_gtk2u_media-2.8, wx_gtk2u_stc-2.8, wx_gtk2u_gl-2.8 And these libraries actually exist in /usr/lib I type

why mingw32 and tdm-gcc64 behave differently using external gcc

大憨熊 提交于 2020-01-06 03:38:30
问题 I am trying to cabal install a component of wxHaskell (Haskell platform 2013.2 against wxWidgets 3.0). I was able to compile the git version with 32 bit mingw from mingw.org. But in the end, the installed wx cannot function correct, and running a minimal example gives runtime exceptions in wxc.dll. So I try to compile the same thing under TDM-GCC 4.8.1 64bit, since the wxWidgets people provide their binary in the form of TDM-GCC compiled binaries. But I immediately run into compilation errors

can't get wxHaskell to work from ghci on Mac

佐手、 提交于 2020-01-02 03:40:19
问题 I'm trying to run an example using EnableGUI function. % ghci -framework Carbon Main.hs *Main> enableGUI >> main This is what I get instead of a working program: 2013-01-14 00:21:03.021 ghc[13403:1303] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /SourceCache/Foundation/Foundation-945.11/Misc.subproj/NSUndoManager.m:328 2013-01-14 00:21:03.022 ghc[13403:1303] +[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread. 2013-01-14 00:21:03

How can I remove widgets from WxHaskell panel

心已入冬 提交于 2019-12-24 10:17:03
问题 My google-fu has failed me. How can I remove widgets that I've added to a Panel () ? For example, in the following, I want the controls -panel to become empty again. buildGUI = do f <- frame [ text := "Hello" ] controls <- panel f [] ctext <- staticText controls [ text := "Foo" ] set controls [ layout := margin 5 (widget ctext) ] set f [ layout := widget controls ] {- delete ctext ? How? -} return () (I'm trying to build a dynamic GUI, and I need to get rid of the old controls when it updates

wxhaskell asynchronous updates

给你一囗甜甜゛ 提交于 2019-12-22 10:20:03
问题 I am using WxHaskell to graphically show the state of a program that advertises state updates using TCP (which I decode using Data.Binary). When an update is received, I want to update the display. So I want the GUI to update its display asynchronously. I know that processExecAsync runs a command line process asynchronously, but I don't think this is what I want. 回答1: This is rough code using transactional variables (i.e. software transactional memory). You could use an IORef, MVar, or

Separating State for a Model and GUI IO ( Wx) : Stack or FRP?

折月煮酒 提交于 2019-12-11 00:35:04
问题 For my diagramming tool, I'd like to keep the code of the core model isolated from the GUI. In the following example, the "state " is passed around with vDiag , which is a Tvar . This is a design decision in wx. Now, For my diagramming tool, I 'd like the core model to be "stored" in a fgl Graph, (with complex types in it), and wx will be given only a view on it; say in this example, a list of points for read access when painting, and some functions to write when clicking, dragging, etc.. . I

wxHaskell labels can't display full text

妖精的绣舞 提交于 2019-12-10 23:30:49
问题 I'm testing wxHaskell on Windows XP using the "Hello World" here: http://www.haskell.org/haskellwiki/WxHaskell/Quick_start But when it runs on my machine, all the text doesn't display. For instance, "Quit" will just display "Q". Any Ideas? 回答1: You need to ensure that the wxWidgets used to build wxhaskell has Unicode support enabled. I think you can check by running wx-config --libs --unicode. What I think is happening is that wxWidgets is expecting simple 8 bit chars but is receiving wide 32

Keep track of the program variables in Haskell like imperative programs

元气小坏坏 提交于 2019-12-10 19:10:17
问题 I'm having a hard time finding out how to make something change every time the user interacts with my program. It's hard to explain so here's an example (Haskell + wxhaskell): simulate :: Int -> Frame () -> IO () simulate qNr window = do fdata <- readFile "qarchive" case (split (listTake (split fdata '\n') qNr 0) '#') of (qst:a:b:c:coralt:answer:x) -> do -- GUI Controls Initialization (buttons,text,etc...) nextButton <- button window [text := "Next Question ->", on command := set infoField

putStrLn doesn't print to console

萝らか妹 提交于 2019-12-07 06:40:05
问题 I am experimenting with wxHaskell. I wasn't able to run the app under ghci, so I have to use application to test it. I wanted to test the program with println debugging. However, it seems that putStrLn doesn't work in GUI: {-# LANGUAGE Haskell2010 #-} module Main where import Graphics.UI.WX drawUI dc view = do circle dc (point 10 10) 5 [penKind := PenSolid, color := red] putStrLn "painted" helloGui :: IO () helloGui = do f <- frame [ text := "Example", resizeable := False, bgcolor := white,