Rune Harder Bak | 29 Nov 14:22 2012
Picon

Simple GUI Form

Hi

I have some input parameters
data Input = ...
that I need the user to enter in a gui pop-up. (windows people...)
The rest of the app is not gui (or perhaps progress could be displayed
in a log-window)

What is the easiest way to make such a GUI form?

It need to compile for both Linux and Windows, so I though WxWidgets was ideal,
and I got wx[1] < 0.90 to install (using wxWidgets2.8) on both windows
and linux.

Now I just need to create the form, but how do you do that?
Any clues or links to examples? I have never used wxwidgets on any
platform or done any other form of GUI before for that matters.
(apart from some Visual Basic ten years ago, and html).

I tried looking at wx examples, but I couldn't find this simple use
case explained anywhere.

I installed wx in the first place because WxGeneric[2] seemed exactly
what I needed,
but I can't get it to compile using ghc7.4.2 from haskell-platform.
Anybody got that working or have some other simple method?

Help much appreciated!

-Rune
(Continue reading)

Ertugrul Söylemez | 29 Nov 14:37 2012
Picon

Re: Simple GUI Form

Hi there Rune,

if you want to get started with declarative GUI programming in Haskell,
I really recommend taking the FRP route.  Check out the
reactive-banana-wx [1] library instead of using wxHaskell directly.  If
you manage to get wxHaskell working on Windows, then reactive-banana
will work as well.

[1]: <http://www.haskell.org/haskellwiki/Reactive-banana>

Greets,
Ertugrul

Rune Harder Bak <rune <at> bak.dk> wrote:

> I have some input parameters
> data Input = ...
> that I need the user to enter in a gui pop-up. (windows people...)
> The rest of the app is not gui (or perhaps progress could be displayed
> in a log-window)
> 
> What is the easiest way to make such a GUI form?
> 
> It need to compile for both Linux and Windows, so I though WxWidgets
> was ideal, and I got wx[1] < 0.90 to install (using wxWidgets2.8) on
> both windows and linux.
> 
> Now I just need to create the form, but how do you do that?
> Any clues or links to examples? I have never used wxwidgets on any
> platform or done any other form of GUI before for that matters.
(Continue reading)

Rune Harder Bak | 29 Nov 15:54 2012
Picon

Re: Simple GUI Form

I'm very interested in FRP,  but all the examples I could see was
forms with "live" feedback
gui like a real-time calculator.
This is a one-time form where the user fills everything in, clicks on a button,
where after the computations might take a long time, perhaps display
some console-info.
But maybe this is a good use-case for reactive-banana as well?
Do you have any good examples in this regard?

On Thu, Nov 29, 2012 at 2:37 PM, Ertugrul Söylemez <es <at> ertes.de> wrote:
> Hi there Rune,
>
> if you want to get started with declarative GUI programming in Haskell,
> I really recommend taking the FRP route.  Check out the
> reactive-banana-wx [1] library instead of using wxHaskell directly.  If
> you manage to get wxHaskell working on Windows, then reactive-banana
> will work as well.
>
> [1]: <http://www.haskell.org/haskellwiki/Reactive-banana>
>
>
> Greets,
> Ertugrul
>
>
> Rune Harder Bak <rune <at> bak.dk> wrote:
>
>> I have some input parameters
>> data Input = ...
>> that I need the user to enter in a gui pop-up. (windows people...)
(Continue reading)

Ertugrul Söylemez | 29 Nov 17:15 2012
Picon

Re: Simple GUI Form

Rune Harder Bak <rune <at> bak.dk> wrote:

> I'm very interested in FRP, but all the examples I could see was forms
> with "live" feedback gui like a real-time calculator.
> This is a one-time form where the user fills everything in, clicks on
> a button, where after the computations might take a long time, perhaps
> display some console-info.
> But maybe this is a good use-case for reactive-banana as well?

Of course.  There is no reason to think that FRP is limited to real-time
applications with complicated interactions.

> Do you have any good examples in this regard?

Not myself, but there is a somewhat comprehensive tutorial [1] as well
as lots of examples [2] linked from the wiki.

I just want to stress the importance of the last tutorial section:  FRP
is not a concrete design pattern, but rather a family of them.  The
tutorial explains FRP as understood and implemented specifically by
reactive-banana.  There are a number of other practical libraries that
use different notions, in particular of events.

[1]: <http://www.haskell.org/haskellwiki/
      FRP_explanation_using_reactive-banana>
[2]: <http://www.haskell.org/haskellwiki/Reactive-banana/Examples>

Greets,
Ertugrul

(Continue reading)

Rune Harder Bak | 30 Nov 21:31 2012
Picon

Re: Simple GUI Form

> Of course.  There is no reason to think that FRP is limited to real-time
> applications with complicated interactions.
(...)
> there is a somewhat comprehensive tutorial [1] as well
> as lots of examples [2] linked from the wiki.

Thank you for the links. I read it and looked at the examples.
It seems you still need to build up the wx gui the same way
as using wx directly and be sure it is in sync with the datatype.
You just handle the logic with reactive-banana.
As there really is almost no logic involved it gives too much overhead,
needing to convert all the widgets to behaviors etc.

I got the form working in wx, so I'll stick with that for now!
Thanks!
timothyhobbs | 29 Nov 20:13 2012
Picon

Re: Simple GUI Form

I know it's not wx, but if you were willing to use GTK, you could simply install:

http://hackage.haskell.org/package/gtk-jsinput

and generate the form automatically as described in:

https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/Custom/JSInput.hs


Timothy


---------- Původní zpráva ----------
Od: Rune Harder Bak <rune <at> bak.dk>
Datum: 29. 11. 2012
Předmět: [Haskell-cafe] Simple GUI Form


Hi

I have some input parameters
data Input = ...
that I need the user to enter in a gui pop-up. (windows people...)
The rest of the app is not gui (or perhaps progress could be displayed
in a log-window)

What is the easiest way to make such a GUI form?

It need to compile for both Linux and Windows, so I though WxWidgets was ideal,
and I got wx[1] < 0.90 to install (using wxWidgets2.8) on both windows
and linux.

Now I just need to create the form, but how do you do that?
Any clues or links to examples? I have never used wxwidgets on any
platform or done any other form of GUI before for that matters.
(apart from some Visual Basic ten years ago, and html).

I tried looking at wx examples, but I couldn't find this simple use
case explained anywhere.

I installed wx in the first place because WxGeneric[2] seemed exactly
what I needed,
but I can't get it to compile using ghc7.4.2 from haskell-platform.
Anybody got that working or have some other simple method?

Help much appreciated!

-Rune

[1] http://hackage.haskell.org/package/wx-0.13.2.3
[2] http://hackage.haskell.org/package/WxGeneric

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Rune Harder Bak | 30 Nov 21:34 2012
Picon

Re: Simple GUI Form

> I know it's not wx, but if you were willing to use GTK, you could simply
> install:
>
> http://hackage.haskell.org/package/gtk-jsinput
>
> and generate the form automatically as described in:
>
> https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/Custom/JSInput.hs

Cool!

Would rather see it generated from the haskell data structure than from json,
but you could of cause generate json from the data type.

My understand is that GTK applications don't look and feel native on
windows/mac, that's why I went for wx,
but I could easily be wrong.
timothyhobbs | 1 Dec 09:00 2012
Picon

Re: Simple GUI Form

I created that for a specific application I was writing, where I was saving the data directly to disk.  I modularized as an afterthought.  But I don't see anything wrong with using types that have JS in their names.  It is STILL a haskell data structure.  Just one which can be converted to a relatively universally parse-able String easily when needed ;)

It's fine if you don't use gtk.  I just wanted to show off my code :)

Timothy


---------- Původní zpráva ----------
Od: Rune Harder Bak <rune <at> bak.dk>
Datum: 30. 11. 2012
Předmět: Re: [Haskell-cafe] Simple GUI Form


> I know it's not wx, but if you were willing to use GTK, you could simply
> install:
>
> http://hackage.haskell.org/package/gtk-jsinput
>
> and generate the form automatically as described in:
>
> https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/Custom/JSInput.hs

Cool!

Would rather see it generated from the haskell data structure than from json,
but you could of cause generate json from the data type.

My understand is that GTK applications don't look and feel native on
windows/mac, that's why I went for wx,
but I could easily be wrong.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Rune Harder Bak | 1 Dec 20:51 2012
Picon

Re: Simple GUI Form

Sure, and thanks for sharing.
We need more declarative GUI building!

On Sat, Dec 1, 2012 at 9:00 AM,  <timothyhobbs <at> seznam.cz> wrote:
> I created that for a specific application I was writing, where I was saving
> the data directly to disk.  I modularized as an afterthought.  But I don't
> see anything wrong with using types that have JS in their names.  It is
> STILL a haskell data structure.  Just one which can be converted to a
> relatively universally parse-able String easily when needed ;)
>
> It's fine if you don't use gtk.  I just wanted to show off my code :)
>
> Timothy
>
>
> ---------- Původní zpráva ----------
> Od: Rune Harder Bak <rune <at> bak.dk>
> Datum: 30. 11. 2012
> Předmět: Re: [Haskell-cafe] Simple GUI Form
>
>
>> I know it's not wx, but if you were willing to use GTK, you could simply
>> install:
>>
>> http://hackage.haskell.org/package/gtk-jsinput
>>
>> and generate the form automatically as described in:
>>
>>
>> https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/Custom/JSInput.hs
>
> Cool!
>
> Would rather see it generated from the haskell data structure than from
> json,
> but you could of cause generate json from the data type.
>
> My understand is that GTK applications don't look and feel native on
> windows/mac, that's why I went for wx,
> but I could easily be wrong.
timothyhobbs | 1 Dec 20:58 2012
Picon

Re: Simple GUI Form

Also GTK, but I ran across this a little while ago http://hackage.haskell.org/package/barrie not sure if it still builds as it's a bit old, but it looked interesting.


---------- Původní zpráva ----------
Od: Rune Harder Bak <rune <at> bak.dk>
Datum: 1. 12. 2012
Předmět: Re: Re: [Haskell-cafe] Simple GUI Form


Sure, and thanks for sharing.
We need more declarative GUI building!

On Sat, Dec 1, 2012 at 9:00 AM, <timothyhobbs <at> seznam.cz> wrote:
> I created that for a specific application I was writing, where I was saving
> the data directly to disk. I modularized as an afterthought. But I don't
> see anything wrong with using types that have JS in their names. It is
> STILL a haskell data structure. Just one which can be converted to a
> relatively universally parse-able String easily when needed ;)
>
> It's fine if you don't use gtk. I just wanted to show off my code :)
>
> Timothy
>
>
> ---------- Původní zpráva ----------
> Od: Rune Harder Bak <rune <at> bak.dk>
> Datum: 30. 11. 2012
> Předmět: Re: [Haskell-cafe] Simple GUI Form
>
>
>> I know it's not wx, but if you were willing to use GTK, you could simply
>> install:
>>
>> http://hackage.haskell.org/package/gtk-jsinput
>>
>> and generate the form automatically as described in:
>>
>>
>> https://github.com/timthelion/gtk-jsinput/blob/master/Graphics/UI/Gtk/Custom/JSInput.hs
>
> Cool!
>
> Would rather see it generated from the haskell data structure than from
> json,
> but you could of cause generate json from the data type.
>
> My understand is that GTK applications don't look and feel native on
> windows/mac, that's why I went for wx,
> but I could easily be wrong.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane