Good First GUI Framework

9 replies [Last post]
davidpgil
Offline
Joined: 08/26/2015

I have written some mostly Javascript and Python based small programs that are less than 2000 lines of code and want to start writing GUI based programs. I have looked at Qt and GTK frameworks, and somehow I feel like they may be quite bloated. I have zero interest in getting hired for my programming skills and would like to use something that matches my beliefs, which are:

1) Must be free and open source
2) Must be super simple and easy to use even at the expense of features
3) Does not need to use OOP to function
4) Must be able to work with compiled programming languages (not Python, Javascript, etc)
5) I dont want to do commandline programs instead unless the commandline is in the GUI

Any suggestions? Are ideals impossible? Number 3 is flexible.

I had a quick look at FLTK (https://www.fltk.org/) and Dear imgui (https://github.com/ocornut/imgui)

Thoughts?

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> I have written some mostly Javascript and Python based small programs
> that are less than 2000 lines of code and want to start writing GUI based
> programs. I have looked at Qt and GTK frameworks, and somehow I feel like
> they may be quite bloated.

The only one I have experience with is GTK.

> 1) Must be free and open source

Yep.

> 2) Must be super simple and easy to use even at the expense of features

Since I haven't used other frameworks I don't have a point of
comparison, so I can't comment on this.

> 3) Does not need to use OOP to function

Nope, but why do you want to avoid this?

> 4) Must be able to work with compiled programming languages (not Python,
> Javascript, etc)

I use the Python bindings, but it's a C library, and it has bindings for
many other languages, so you can use a compiled language if you want to.
Why do you want to avoid interpreted languages?

> 5) I dont want to do commandline programs instead unless the commandline
> is in the GUI

Glade is a nice graphical tool for designing GTK interfaces. It outputs
a .glade file, which you load in your code and connect signals to
handler functions to program the behavior.

davidpgil
Offline
Joined: 08/26/2015

> I have written some mostly Javascript and Python based small programs
> that are less than 2000 lines of code and want to start writing GUI based
> programs. I have looked at Qt and GTK frameworks, and somehow I feel like
> they may be quite bloated.

The only one I have experience with is GTK.

>> What are the pros and cons of GTK to you?

> 1) Must be free and open source

Yep.

>> Would be "funny" if GTK wasn't open source :)

> 2) Must be super simple and easy to use even at the expense of features

Since I haven't used other frameworks I don't have a point of
comparison, so I can't comment on this.

> 3) Does not need to use OOP to function

Nope, but why do you want to avoid this?

>> I am not used to working in an OOP way and find it isn't necessary. I feel OOP is for when there is a pre-designed plan by an authority and that plan must be implemented according to the design. However, I will admit I dont have much experience with OOP. I guess my brain just doesnt work in an OOP way. I like ideas that I have read about regarding functional programming much better by comparision.

> 4) Must be able to work with compiled programming languages (not Python,
> Javascript, etc)

I use the Python bindings, but it's a C library, and it has bindings for
many other languages, so you can use a compiled language if you want to.
Why do you want to avoid interpreted languages?

>> I find the interpreted languages so convenient that I feel I am not being allowed to be become a better programmer. I would also like to leverage processing speed benefits of C and C++. I also started with C and I feel I would like to just get better at just using it and that process of compiling, etc. I also want to write programs that can handle processing of graphics and heavier types of data in a fast way. Like making my own version of photoshop, 3d software, music software, etc.

> 5) I dont want to do commandline programs instead unless the commandline
> is in the GUI

Glade is a nice graphical tool for designing GTK interfaces. It outputs
a .glade file, which you load in your code and connect signals to
handler functions to program the behavior.

>> Interesting. If I can pester you with questions I may go the GTK route if there is some helpful tool to make things easier.

...

The plan is to work on this tool I have in mind at my job during my downtime and add features to it as needed. essentially I'd like to make something like blender but highly specified to what I want to do with it. Not blender as a 3d software, but a software that does many things that sometimes overlap with eachother.

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> I am not used to working in an OOP way and find it isn't necessary. I feel OOP is for when there is a pre-designed plan by an authority and that plan must be implemented according to the design. However, I will admit I dont have much experience with OOP. I guess my brain just doesnt work in an OOP way. I like ideas that I have read about regarding functional programming much better by comparision.

What exactly do you mean. Are you saying that you don't like to use classes in Python? For a simple program you can probably get by like that, but don't be afraid of it.

> I find the interpreted languages so convenient that I feel I am not being allowed to be become a better programmer. I would also like to leverage processing speed benefits of C and C++. I also started with C and I feel I would like to just get better at just using it and that process of compiling, etc. I also want to write programs that can handle processing of graphics and heavier types of data in a fast way. Like making my own version of photoshop, 3d software, music software, etc.

It's admirable to want to push yourself to learn unfamiliar languages, but I encourage you not to do so simultaneously with pushing yourself to learn a GUI toolkit. Learn one new skill at a time. Either first learn a new language by writing a familiar sort of program, or learn to use a GUI toolkit using a familiar language. If you try to learn a GUI toolkit in an unfamiliar language, then when something goes wrong you wont know whether it's because its because you're using the toolkit wrong or using the language wrong.

Maybe you could start by writing creating a simple GTK interface in Glade, and then program its behavior using the Python bindings since you're familiar with Python. Once you have that working, you could try porting your Python code to C (the .glade file is language-agnostic).

davidpgil
Offline
Joined: 08/26/2015

Im not afraid of using classes in Python. I just find that the programs I have written don't need classes. I have only needed to use functions. Why are classes needed? What is the absolutely necessary use-case for them? I have never written anything that needs them.

Good point about not battling in too many fronts. OK ill try GTK using Glade with Python bindings and possibly port parts to C if I need a speed boost somewhere.

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> Im not afraid of using classes in Python. I just find that the
> programs I have written don't need classes. I have only needed to use
> functions. Why are classes needed? What is the absolutely necessary
> use-case for them? I have never written anything that needs them.

In theory, I guess that they are never *strictly* necessary, but they
are useful, and I think it would be hard to write a very large program
without them. For the same reason it is easier to have a string type
than to create an array of characters every time you need to represent a
word, and easier to have a character type than to use integers to
represent ascii characters every time you need to represent a letter,
sometimes you'll have your own thing you need do frequently, and it is
easier to create a class and reuse it than to rebuild it every time.

> Good point about not battling in too many fronts. OK ill try GTK using
> Glade with Python bindings and possibly port parts to C if I need a
> speed boost somewhere.

Cool, I've only started learning GTK in the last few weeks, but I've
gotten pretty far along, so let me know if you need help. Here[1] is a
tutorial covering the basics, which I found helpful as I was getting
started. This page[2] covers loading your .glade file into your
program. Here[3] is an API reference for the Python bindings, which has
been pretty helpful for figuring out what various objects do.

[1] https://python-gtk-3-tutorial.readthedocs.io

[2] https://python-gtk-3-tutorial.readthedocs.io/en/latest/builder.html

[3] https://lazka.github.io/pgi-docs/

davidpgil
Offline
Joined: 08/26/2015

Its possible I have never written anything so complex as to need classes. Anyhow, I would use them if I felt it was needed. I just don't like using things just because. I need there to be a very good reason.

Thanks for the links and availability, friend. Much appreciated.

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

As https://en.wikipedia.org/wiki/Turing_completeness says:
Virtually all programming languages today are Turing complete.

So, yes, you can theoretically achieve anything a computer can do using any programming paradigm (procedural, object-oriented, functional, etc.).

There are very large programs that are not written in an object-oriented language but are well architected, because they are modular. Linux is probably the best example.

Finally (a detail), all popular procedural languages (such as C) have a primitive type to to encode a character: https://en.wikipedia.org/wiki/Character_(computing)#char

chaosmonk

I am a member!

I am a translator!

Offline
Joined: 07/07/2017

> There are very large programs that are not written in an object-oriented
> language but are well architected, because they are modular. Linux is
> probably the best example.
>
> Finally (a detail), all popular procedural languages (such as C) have a
> primitive type to to encode a character:
> https://en.wikipedia.org/wiki/Character_(computing)#char

I know, I was trying to explain in a simple way why classes can be
useful in Python.

davidpgil
Offline
Joined: 08/26/2015

im actually starting this. have time at work ^_^