From: Henk-Jan v. T. <hj...@ch...> - 2009-02-20 13:25:15
|
On Fri, 20 Feb 2009 00:17:05 +0100, Eric <er...@ma...> wrote: > Dear all, > > When I run the following program I get a "Segmentation fault/access > violation". Can anyone see the problem? > > *** > > main = start gui > > > gui = do{ > f <- frame [text := ""] > ;book <- notebook f [] > ;page <- new_page f > ;set f [layout := tabs book [page]] > ;set f [position := pt 0 0, clientSize := sz 900 700] > ;return()} > > > new_page :: Window a -> IO TabPage > new_page wnd = do > txt_gui <- textCtrl wnd [] > pnl <- panel wnd [] > empty_bitmap <- bitmapCreateEmpty (sz 1 1) 1 > let tab_page = ("Blank", empty_bitmap, container pnl (fill . widget > $ txt_gui)) > return tab_page > > *** > > Eric M. The GHCi debugger [1] shows that the crash occurs while evaluating the line: > ;set f [layout := tabs book [page]] The description of "tabs" contains the phrase: The pages always need to be embedded inside a container See the file samples\wx\Controls.hs of the wxHaskell package for an example how to use a notebook. [1] http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-debugger.html -- Regards, Henk-Jan van Tuyl -- http://functor.bamikanarie.com http://Van.Tuyl.eu/ -- |