Advertisement

How to create a Calculator with Buttons and Text boxes in ImGui?

Started by September 15, 2020 08:22 PM
15 comments, last by SuperVGA 4 years, 2 months ago

Hi there,

I wanted to make a calculator in ImGui. I have done a lot of research, but I have had no luck with it. This is my last opportunity.

Buttons = Buttons and Display box with input output systems = Code.

Text box = 2 text boxes 1 display box. If anyone knows the answer please help.

If you don't understand tell me what you don't understand.

Thanks

How is this different from before?

Post some code, or at least ask a more specific question. Want the buttons to display differently? Not sure what one of the flags does?

`ImGui::Button` and `ImGui::Text` ("display box") are probably what you want.

Advertisement

@SyncViews I know that. But this is the thing I dont know how to bring the input output systems. AND thank you for answering the question. Soo ImGui::text() is for a text box. Thanks. I have checked videos but there are non. Soo thats why I am asking you for the front and back code. Thanks soo much for the answer. And how can I and the front and back systems output to imgui::text? Thanks. Just the front and back system.

Don't rely on videos, this is all on the GitHub links you had.

Post some code that you had. Start with just displaying a string with the sequence of buttons pressed, maybe using `std::string` and just append to it for now when the button is pressed.

Shaanveer said:
This is my last opportunity. … If you don't understand tell me what you don't understand.

I don't understand how this is your last opportunity. Why can't you just keep trying?

-- Tom Sloper -- sloperama.com

Shaanveer said:

If you don't understand tell me what you don't understand.

I don't understand why you haven't progressed with all the advice you've been given. Also, why do you suddenly cut your threads short and start over with a similar topic?

Advertisement

@Tom Sloper Beacause im tired of getting into a arguement. Just give the answer like @sync views

@SyncViews Do you mean there?

Build and run the imgui example program (maybe this one for OpenGL https://github.com/ocornut/imgui/blob/master/examples/imgui_impl_opengl3.cpp​ )

Observe that it has many buttons etc. Then read and understand this for how they did those controls: https://github.com/ocornut/imgui/blob/master/imgui_demo.cpp#L224

And all the docs and functions you can call in this for what the options are: https://github.com/ocornut/imgui/blob/master/imgui.h

Your not going to find videos or copy-paste for a lot of this stuff. Using `ImGui::Text` to display some output and `ImGui::Button` multiple times for a number of buttons is really basic for the audience this sort of library is targeting. They might show a few of the controls as an example, but not full solutions or how exactly each of the things works.

If you have some specific piece of the demo code you don't understand, or a piece of your own code that doesn't work sure ask about that, with a runnable code example (e.g. dropped into one of the ImGui demo Main.cpp files).

@SuperVGA Why don't you just answer the question then?

Shaanveer said:

@SuperVGA Why don't you just answer the question then?

What is the question? Your post doesn't have any questions in it.

When you're asked questions however, like “what is a display box” or what does “input output systems = code” mean, you start a new thread.
If you were better at answering questions and describing problems you'd be better off.

This topic is closed to new replies.

Advertisement