# LazyGUI - a GUI library for easy iteration

**URL:** <https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120>\
**Category:** Gallery\
**Tags:** contributions\
**Created:** [March 2, 2023, 11:49am UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120 "2023-03-02T11:49:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![krab](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/krab/32/18229_2.png) [@krab](https://discourse.processing.org/u/krab)\
**Post date:** [March 2, 2023, 11:49am UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/1 "2023-03-02T11:49:44Z")

</div>

Check out this GUI library I made, it aims to tighten the iteration loop even more than previously thought possible and I’d love to hear your thoughts on it before I submit it to the processing foundation as a potentially official library…

Find the readme, source and jar on github:  
[https://github.com/KrabCode/LazyGui](https://github.com/KrabCode/LazyGui)

 ![header](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/8/98f5c3ffc0a5ca3dd0aa0cceeba065dd69ad7bd0.png)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 2, 2023, 6:41pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/2 "2023-03-02T18:41:56Z")

</div>

…and what is so easy about it…?

---

<div class="post-metadata">

**Author:** ![krab](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/krab/32/18229_2.png) [@krab](https://discourse.processing.org/u/krab)\
**Post date:** [March 2, 2023, 8:33pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/3 "2023-03-02T20:33:48Z")

</div>

You don’t need to declare control elements in setup() or keep track of any objects - you just query what values you need in draw() using a unique path and they get lazily initialized the first time you do it. Way easier to change things when it’s all together in the draw() function.

Also your GUI values can get autosaved when closing the sketch so you can jump right back to where you were when you just want to edit a piece of the code and re-run it.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 2, 2023, 9:01pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/4 "2023-03-02T21:01:33Z")

</div>

Impressive.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [March 9, 2023, 5:52pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/5 "2023-03-09T17:52:00Z")

</div>

Very handy lib.  
It’s now an essential tool in my everyday’s workflow.  
Thanks

---

<div class="post-metadata">

**Author:** ![thesandrobrito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/thesandrobrito/32/12634_2.png) [@thesandrobrito](https://discourse.processing.org/u/thesandrobrito)\
**Post date:** [April 4, 2023, 2:12pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/6 "2023-04-04T14:12:26Z")

</div>

@krab This is great.  
I keep getting this error in one of my sketches tho  
“ClassCastException: class processing.awt.PSurfaceAWT$SmoothCanvas cannot be cast to class com.jogamp.newt.opengl.GLWindow (processing.awt.PSurfaceAWT$SmoothCanvas and com.jogamp.newt.opengl.GLWindow are in unnamed module of loader ‘app’)”

---

<div class="post-metadata">

**Author:** ![krab](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/krab/32/18229_2.png) [@krab](https://discourse.processing.org/u/krab)\
**Post date:** [April 4, 2023, 2:25pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/7 "2023-04-04T14:25:44Z")

</div>

That’s interesting, I don’t get that at all - could you share some minimal sketch code so that I could reproduce it? What OS are you on? Also consider joining the discord, link at the bottom of the readme, for easier troubleshooting chats.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [April 4, 2023, 4:36pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/8 "2023-04-04T16:36:19Z")

</div>

Sketch must be `P2D`.

---

<div class="post-metadata">

**Author:** ![thesandrobrito](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/thesandrobrito/32/12634_2.png) [@thesandrobrito](https://discourse.processing.org/u/thesandrobrito)\
**Post date:** [April 4, 2023, 5:16pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/9 "2023-04-04T17:16:05Z")

</div>

Thanks, this worked!!

---

<div class="post-metadata">

**Author:** ![krab](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/krab/32/18229_2.png) [@krab](https://discourse.processing.org/u/krab)\
**Post date:** [April 5, 2023, 6:01am UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/10 "2023-04-05T06:01:25Z")

</div>

The GUI should have printed a warning before the exception though. I don’t know if you saw that. Anyway, we’re moving the warning into a full exception in 1.0.1 so it’s more obvious and you don’t see this confusing error at all.

---

<div class="post-metadata">

**Author:** ![krab](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/krab/32/18229_2.png) [@krab](https://discourse.processing.org/u/krab)\
**Post date:** [April 5, 2023, 12:13pm UTC](https://discourse.processing.org/t/lazygui-a-gui-library-for-easy-iteration/41120/11 "2023-04-05T12:13:03Z")

</div>

This is not entirely accurate - the sketch can be P3D too. It just can’t use the default renderer.
