1

I was browsing the Haskell Platform documentation and found this library. It has only one line of explanation: A collection of FFI declarations for interfacing with Win32.

Is this library intended for building UI on windows ? If so could anyone show a short example ?

1
  • 1
    It can be used but I guess you'll get faster results by using GTK, wxWidgets or QT bindings. Or, for more functional GUIs, try 2-penny-gui :) Commented Jan 18, 2014 at 0:29

1 Answer 1

2

TL;DR: Yes, but don't. Ugliness alert.

It is indeed a set of bindings directly onto the win32 API, which means you can use it to make a UI, but you essentially have to write like a C programmer who doesn't have a toolkit.

It's not pretty, and I'd like to strongly recommend you use a toolkit like GTK or WX, or better still a Functional Reactional Programming library like reactive banana. Those libraries will give you much more idiomatic and eassy-to-understand Haskell code, and portability comes for free.

Occasionally some library you use doesn't feature something you need, whereupon you might want to delve into the windows API.

If you're determined to use this, you need a good Win32 API tutorial to learn from, together with a good reference whilst actually coding. There are loads out there if you google, and plenty of books, but none of them fit into a stackoverflow answer. Whilst I don't know of any Win32 API tutorials written in Haskell, using the bindings provided in Graphics.Win32 means all the function names match up with those in the online documentation, so you should be able to translate.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.