From: Daan L. <daa...@xs...> - 2004-04-26 11:39:25
|
On Mon, 26 Apr 2004 01:18:11 -0700, David Bakin <d....@co...> wrote: > Hi. I'd like to call statusBarSetStatusWidths - apparently it wants an array of integers (the status field widths) - how do I create that as a Ptr CInt? Hi Dave, This should be in wxhaskell of course, I'll add it to the next version. For now, you can use the same code as in "WXCore.Frame.statusBarCreateFields". If you don't have access to the sources, here it is: import Foreign.Marshal.Array ... statusBarCreateFields :: Frame a -> [Int] -> IO (StatusBar ()) statusBarCreateFields parent widths = do ... then do withArray (map toCInt widths) (\pwidths -> statusBarSetStatusWidths sb (length widths) pwidths) ... All the best, Daan. btw. I am curious why you need to call this function? Are the functions in "WX.Menu" not good enough (and why not)? Maybe we can improve the interface? |