On Fri, 20 Feb 2009 00:17:05 +0100, Eric <[email protected]> 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/
--



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
wxhaskell-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to