From: David B. <d....@co...> - 2004-04-26 08:18:27
|
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? Thanks! -- Dave |
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? |
From: David B. <d....@co...> - 2004-04-26 18:13:29
|
Because I didn't know about it! I was looking in Controls for a status bar wrapper, not Menus. None of the samples had status bars and I wanted to start off by doing something that wasn't in the samples. I guess I need to browse *all* of the documentation so I have a better idea of what's where. Thanks for your help! -- David ----- Original Message ----- From: "Daan Leijen" <daa...@xs...> To: "David Bakin" <d....@co...>; <wxh...@li...> Sent: Monday, April 26, 2004 4:39 AM Subject: Re: [wxhaskell-users] How do I call statusBarSetStatusWidths :: StatusBar a -> Int -> Ptr CInt -> IO () > 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? > > |
From: Daan L. <daa...@xs...> - 2004-04-26 18:55:24
|
On Mon, 26 Apr 2004 11:13:11 -0700, David Bakin <d....@co...> wrote: > Because I didn't know about it! I was looking in Controls for a status bar > wrapper, not Menus. None of the samples had status bars and I wanted to > start off by doing something that wasn't in the samples. I guess I need to > browse *all* of the documentation so I have a better idea of what's where. > > Thanks for your help! -- David You've hit one the most important issues wxHaskell: documentation :-) Although I think that it is a good thing that there is at least some (good) documentation, it would be good if there was some better overview of where to find the things you are looking for -- especially with regard to attributes. Success with the statusbars, -- Daan. ps. See the "samples/wx/" "minimal" and "imageviewer" example for a statusbar > > ----- Original Message ----- > From: "Daan Leijen" <daa...@xs...> > To: "David Bakin" <d....@co...>; > <wxh...@li...> > Sent: Monday, April 26, 2004 4:39 AM > Subject: Re: [wxhaskell-users] How do I call statusBarSetStatusWidths :: > StatusBar a -> Int -> Ptr CInt -> IO () > > >> 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? >> >> > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > wxhaskell-users mailing list > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > |