https://wiki.haskell.org/api.php?action=feedcontributions&user=Javran&feedformat=atomHaskellWiki - User contributions [en]2024-03-19T02:45:57ZUser contributionsMediaWiki 1.35.5https://wiki.haskell.org/index.php?title=Reactive-banana/Examples&diff=57719Reactive-banana/Examples2014-03-30T01:53:29Z<p>Javran: fix broken links</p>
<hr />
<div>Examples for the reactive-banana library.<br />
<br />
== Core Examples ==<br />
<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana/doc/examples/SlotMachine.hs SlotMachine.hs]<br />
: Mainly demonstrates how to set up an event network with your own event loop. Also demonstrates the FRP functionality.<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana/doc/examples/ActuatePause.hs ActuatePause.hs]<br />
: Demonstrates how to set up an event network with your own event loop and how to pause or resume it.<br />
<br />
== GUI Examples - Very simple ==<br />
<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Arithmetic.hs Arithmetic.hs]<br />
: Minimalistic calculator that can add two numbers. Demonstrates how to read values from text entries.<br />
:[[Image:Reactive-banana-Arithmetic.png]]<br />
<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Counter.hs Counter.hs]<br />
: A simple counter that can be manipulated with two buttons "Up" or "Down". Demonstrates how to get events from button clicks and how to accumulate values using the <code>accumB</code> function.<br />
:[[Image:Reactive-banana-Counter.png]]<br />
<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/NetMonitor.hs NetMonitor.hs]<br />
: Minimalistic application that displays network statistics in real time. Demonstrates the <code>fromPoll</code> function.<br />
:[[Image:Reactive-banana-NetMonitor.png]]<br />
<br />
; <span id="CurrencyConverter">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/CurrencyConverter.hs CurrencyConverter.hs]<br />
: Simple currency converter. Reads and writes values to text entry widgets in real-time. Demonstrates bidirectional controls.<br />
:[[Image:Reactive-banana-CurrencyConverter.png]]<br />
<br />
; <span id="twoCounters">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/TwoCounters.hs TwoCounters.hs]<br />
: Two simple counters. There is only one pair of buttons "Up" or "Down", the button "Switch Counters" allows you to specify which counter should be affected.<br />
:[[Image:Reactive-banana-TwoCounters.png]]<br />
<br />
== GUI Examples - More elaborate ==<br />
<br />
; <span id="animation">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Animation.hs Animation.hs]</span><br />
: A small interactive animation. The sprite follows the mouse pointer.<br />
:[[Image:Reactive-banana-Animation.png]]<br />
<br />
; <span id="asteroids">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Asteroids.hs Asteroids.hs]</span><br />
: Port of the [[wxAsteroids]] example.<br />
: [[Image:Reactive-banana-Asteroids.png]]<br />
<br />
; <span id="bartab">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/BarTab.hs BarTab.hs]</span><br />
: Add all numbers on the tab. Demonstrates how to dynamically create widgets and <code>Behavior</code>s.<br />
:[[Image:Reactive-banana-BarTab.png]]<br />
<br />
; <span id="crud">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/CRUD.hs CRUD.hs]</span><br />
: A toy CRUD (Create/Read/Update/Destroy) application. The code is quite pleasant. Unfortunately, bidirectional controls are still hard to describe, I have left this in a somewhat buggy state. Future updates will rectify this.<br />
:[[Image:Reactive-banana-CRUD1.png]] [[Image:Reactive-banana-CRUD2.png]]<br />
<br />
; [https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/TicTacToe.hs TicTacToe.hs]<br />
: A version of TicTacToe. Based on a version by Gideon Sireling.<br />
:[[Image:Reactive-banana-TicTacToe.png]]<br />
<br />
; <span id="wave">[https://github.com/HeinrichApfelmus/reactive-banana/blob/master/reactive-banana-wx/src/Wave.hs Wave.hs]</span><br />
: A wave-like pattern. Not the most beautiful code, but it demonstrates that you can generate timed events.<br />
:[[Image:Reactive-banana-Wave.png]]</div>Javran