# Currency Converter : how to make a window with text and buttons?

**URL:** <https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256>\
**Category:** Processing.py\
**Tags:** homework\
**Created:** [May 24, 2021, 8:33pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256 "2021-05-24T20:33:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bridgette](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bridgette](https://discourse.processing.org/u/bridgette)\
**Post date:** [May 24, 2021, 8:33pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/1 "2021-05-24T20:33:02Z")

</div>

Hi!  
I have to create a currency converter, without having to use any GUI libraries, so I wanted to create a window where all the text and button would be. I wanted to use `def setup` and `def draw` functions but I’m not sure what code to write to make a window. Does anyone have any suggestions?

I’ve added `line(mouseX,mouseY, pmouseX,pmouseY)` under the `def draw` function but I need the window, so would I make a square for example?

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 24, 2021, 8:59pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/2 "2021-05-24T20:59:23Z")

</div>

Hi @bridgette ,

When you talk about the window are you talking about drawing an inner window? Because when using the `setup()` and `draw()` function, you already have the Processing window that you can use.

---

<div class="post-metadata">

**Author:** ![bridgette](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bridgette](https://discourse.processing.org/u/bridgette)\
**Post date:** [May 24, 2021, 9:02pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/3 "2021-05-24T21:02:16Z")

</div>

Hello,

Thanks for your response! Yup, I mean a window where all my components for the currency converter will be. So, essentially a square in the Processing window. I tried using `global square` under the `def draw` function but I don’t even think that makes sense, and the program didn’t run.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 24, 2021, 9:05pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/4 "2021-05-24T21:05:45Z")

</div>

Ok so if you are new to Processing, you should take a look at the tutorials on the website :

[https://py.processing.org/tutorials/](https://py.processing.org/tutorials/)

it will teach you how to display shapes and draw whatever you want with Processing.

Then you can start to think about how you would make that window with text, buttons… 😉

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 24, 2021, 9:53pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/5 "2021-05-24T21:53:14Z")

</div>

Please note that this post is a duplicate of : [Please Help: Currency Converter - #7 by bridgette](https://discourse.processing.org/t/please-help-currency-converter/30250/7)

---

<div class="post-metadata">

**Author:** ![bridgette](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bridgette](https://discourse.processing.org/u/bridgette)\
**Post date:** [May 24, 2021, 9:54pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/6 "2021-05-24T21:54:09Z")

</div>

I just had a separate question about the same assignment.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 24, 2021, 9:55pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/7 "2021-05-24T21:55:55Z")

</div>

Ok I just renamed the topic then 😉

---

<div class="post-metadata">

**Author:** ![bridgette](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@bridgette](https://discourse.processing.org/u/bridgette)\
**Post date:** [May 24, 2021, 9:57pm UTC](https://discourse.processing.org/t/currency-converter-how-to-make-a-window-with-text-and-buttons/30256/8 "2021-05-24T21:57:16Z")

</div>

Alright then, thank you.
