[Haskell-cafe] Haskell image libraries

Andrew Coppin andrewcoppin at btinternet.com
Sun Nov 8 11:02:32 EST 2009


Max Rabkin wrote:
> On Sun, Nov 8, 2009 at 5:09 PM, Max Rabkin <max.rabkin at gmail.com> wrote:
>   
>> On Sun, Nov 8, 2009 at 4:58 PM, Andrew Coppin
>> <andrewcoppin at btinternet.com> wrote:
>>     
>>> Try AC-EasyRaster-GTK.
>>>       
>> Thanks, I'll give that a try
>>     
>
> Having downloaded it, I must admit I was a bit put off by seeing things like
> init_system :: IO ()
> process_event :: IO ()
> wait_event :: IO ()
> main_loop :: IO ()
> in an image library.
>
> But it's the best we've got right now, so I've got a couple questions:
> is it safe to call init_system more than once? And what do I need the
> event-handling functions for, if anything?
>   

If all you want to do is load/save images and do pixel I/O on them, you 
can completely ignore process_event, wait_event, main_loop, etc. All you 
need to do is make sure you call init_system at the start of your program.

(You see the ib_display function? If you want *that* to work properly, 
you need to run the GTK event loop, which is what these event-related 
functions are all about. If you're not trying to display the image on 
screen, you can ignore all that.)

I should probably make the documentation clearer...



More information about the Haskell-Cafe mailing list