# Gtk Qt Web to make a GUI?

**URL:** <https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822>\
**Category:** Uncategorized\
**Created:** [May 30, 2025, 9:11am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822 "2025-05-30T09:11:43Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [May 30, 2025, 9:11am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/1 "2025-05-30T09:11:43Z")

</div>

Dear friends,

I developed some structural design applications in Fortran.  
Now I want a GUI.  
I first tried Gtk. I gave up. It took me days and still no success. Each time I thought I was where I wanted, another dependency popped up.  
Then I made a Web based interface. It’s OK but not exactly what I wanted. Moreover it depends on MS .NET, so I think it won’t work on other platforms. and it supposes some knowledge of C#, HTML, CSS, .NET, JavaScript, [ASP.NET](http://ASP.NET) …  
I’m a retired structural engineer, no software engineer, doing this as a hobby hoping my work will be of some use for my colleagues.  
I suppose I could make time to study all these items, I don’t know if it’s worth the effort.  
I use DISLIN. It’s OK for graphs but not for making a modern looking interface.  
So perhaps I should give Qt a chance.  
Any advice?

Roger

---

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [May 30, 2025, 11:14am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/2 "2025-05-30T11:14:40Z")

</div>

If you are not against using Python in between I would recommend you a slightly different strategy:  
Use Fortran to create your application as a Dynamic shared library \> Expose it on Python using [numpy.ctypeslib](https://numpy.org/doc/stable/reference/routines.ctypeslib.html), on the Fortran side you would have to declare your public procedures as `bind(c)` the input/output arguments of those procedures shall use `iso_c_binding` types declaration\> use [streamlit](https://streamlit.io/gallery) to create a pretty looking GUI using Python. It is also Web based but can run locally or as sever, up to you.

---

<div class="post-metadata">

**Author:** ![jwmwalrus](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jwmwalrus/32/4483_2.png) [@jwmwalrus](https://fortran-lang.discourse.group/u/jwmwalrus)\
**Post date:** [May 30, 2025, 11:46am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/3 "2025-05-30T11:46:18Z")

</div>

> [@rmoortgat](#):
>
> So perhaps I should give Qt a chance.  
> Any advice?

Actually, for an all-Fortran solution, Gtk+ is still your best bet, since (like many other languages) Fortran’s FFI is only with C.

Having an operating system with a proper package manager could make things easier —e.g., installing Gtk+ in a Debian-derived machine is as easy as `sudo apt install gtk-3-dev`, even though it has layers upon layers of dependencies:

```bash
$ pkg-config gtk+-3.0 --libs --keep-system-libs 
-L/usr/lib/x86_64-linux-gnu -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0

```

If your operating system is Windows, maybe with WSL you can enable a linux box to make things easier?

Qt, on the other hand, is a C++ set of libraries, and therefore mangling is the norm.

@hkvzjal 's general suggestion might also work, using either Python (or PyQt) or C++ as the front-end.

---

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [May 30, 2025, 11:53am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/4 "2025-05-30T11:53:05Z")

</div>

> [@jwmwalrus](#):
>
> If your operating system is Windows, maybe with WSL you can enable a linux box to make things easier?

After 5 years of heavy use of WSL I can say that this is not a robust solution. I’ve come to understand that for Windows developers, WSL is **just** a facility tool to ensure that the code also works on linux, but by no means can it be seen as a replacement for native code, specially if one intends to give the application to others. So I would advise against any approach that only works on linux and that for Windows requires a WSL.

> [@jwmwalrus](#):
>
> @hkvzjal 's general suggestion might also work, using either Python (or PyQt)

Using streamlit you avoid Qt, PyQt, C++ all together.

---

<div class="post-metadata">

**Author:** ![jwmwalrus](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/jwmwalrus/32/4483_2.png) [@jwmwalrus](https://fortran-lang.discourse.group/u/jwmwalrus)\
**Post date:** [May 30, 2025, 11:55am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/5 "2025-05-30T11:55:47Z")

</div>

> [@hkvzjal](#):
>
> After 5 years of heavy use of WSL I can say that this is not a robust solution.

I don’t use Windows, so I have no idea how good a solution it is. I suggested it (with a question mark at the end), because it’s been on the news lately, after Microsoft open-sourced it.

---

<div class="post-metadata">

**Author:** ![hkvzjal](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/hkvzjal/32/3055_2.png) [@hkvzjal](https://fortran-lang.discourse.group/u/hkvzjal)\
**Post date:** [May 30, 2025, 12:01pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/6 "2025-05-30T12:01:20Z")

</div>

The best way to see the WSL as of today is as very friendly virtual environment to ensure cross-platform development, but not as a replacement for native applications.

---

<div class="post-metadata">

**Author:** ![Cean](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@Cean](https://fortran-lang.discourse.group/u/Cean)\
**Post date:** [May 30, 2025, 12:30pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/7 "2025-05-30T12:30:13Z")

</div>

I use Intel fortran for GUI on windows. It only has menu. I draw toolbars by myself with OpenGL.

---

<div class="post-metadata">

**Author:** ![epasveer](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@epasveer](https://fortran-lang.discourse.group/u/epasveer)\
**Post date:** [May 30, 2025, 1:55pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/8 "2025-05-30T13:55:21Z")

</div>

Can you describe more about what you want to visualize in the GUI?

I suspect there will be buttons and other widgets. Will there be any graphics like OpenGL needed?

Perhaps include a screenshot of one of your other attempts.

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [May 30, 2025, 3:24pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/9 "2025-05-30T15:24:05Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/8/874c5f5073ba66f59b29a82dd7c19d55f33c48e3.png)

---

<div class="post-metadata">

**Author:** ![Neels](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@Neels](https://fortran-lang.discourse.group/u/Neels)\
**Post date:** [May 31, 2025, 6:56am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/10 "2025-05-31T06:56:44Z")

</div>

I use Intel Fortran in Microsoft Visual Studio and create this interface using QuickWin:

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/6/65812bcb09646f714c9c69192677f97ae0d3d6eb.png)

---

<div class="post-metadata">

**Author:** ![Cean](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@Cean](https://fortran-lang.discourse.group/u/Cean)\
**Post date:** [May 31, 2025, 7:04am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/11 "2025-05-31T07:04:17Z")

</div>

Is this made with dislin?

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [May 31, 2025, 7:47am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/12 "2025-05-31T07:47:16Z")

</div>

This is exactly the interface I’m looking for. I considered QuickWin too but it is, in my opinion, very poorly documented. Could you give me some clues to get started?

Roger

---

<div class="post-metadata">

**Author:** ![Neels](https://avatars.discourse-cdn.com/v4/letter/n/9f8e36/32.png) [@Neels](https://fortran-lang.discourse.group/u/Neels)\
**Post date:** [May 31, 2025, 7:58am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/13 "2025-05-31T07:58:29Z")

</div>

By far the easiest is to use one of the example projects they supply and modify it.

Also the book by Norman Lawrence is a great help. Qwin has not really changed since the Dec/Compaq days.

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [May 31, 2025, 8:22am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/14 "2025-05-31T08:22:12Z")

</div>

OK, Thanks. I have the book

---

<div class="post-metadata">

**Author:** ![vmagnin](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/vmagnin/32/28_2.png) [@vmagnin](https://fortran-lang.discourse.group/u/vmagnin)\
**Post date:** [May 31, 2025, 8:41am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/15 "2025-05-31T08:41:21Z")

</div>

The Intel Quickwin documentation is here:

> **[Using QuickWin](https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-reference-build-windows-applications/15-0/using-quickwin.html)**
>
> This document describes how to use features specific to Windows\* OS when building applications using the Intel® Visual

Of course, Intel Fortran offers QuickWin only under Windows. But it is possible to make such programs run in Linux using the [WineHQ](https://www.winehq.org/) “emulator” (Well, Wine Is Not an Emulator 🙂 ).

---

<div class="post-metadata">

**Author:** ![Kspc](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@Kspc](https://fortran-lang.discourse.group/u/Kspc)\
**Post date:** [May 31, 2025, 11:10am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/16 "2025-05-31T11:10:26Z")

</div>

Your example could be implemented using Silverfrost FTN95’s native Clearwin+ library. I don’t see anything in your example that’s beyond Clearwin+. Fields to enter parameters, buttons to do calculations, simple graph plotting etc, are all possible.

This was the reason i adopted FTN95 as my preferred fortran compiler about 12 years ago. I am an almost retired electrical engineer, regularly modernising my old F77 codes for the next generation of engineers.

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [May 31, 2025, 2:15pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/17 "2025-05-31T14:15:51Z")

</div>

I’m 79 and retired since beginning of this Year.  
That would be ideal but I am afraid I can’t afford that from my meager pension 🙂

Roger

---

<div class="post-metadata">

**Author:** ![BB\_UK](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@BB\_UK](https://fortran-lang.discourse.group/u/BB_UK)\
**Post date:** [May 31, 2025, 4:13pm UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/18 "2025-05-31T16:13:41Z")

</div>

Hi Roger,

hkvzjal’s suggestion to use Python to provide the GUI and then call your own code (written in whatever language) is one of the things I’ve started doing myself.  
The advantage with Python is that once you have your processed data in an array (numpy or otherwise) you can then export it with modules such as drawSVG (for importing SVG directly into desktop editing tools; Word / LibreOffice etc) and such as ezdxf for export to R12 era DXF (so everyone in the world can read it).

Hope this gives you another rabbit hole to go down. 😉

Br,  
Bob

---

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://fortran-lang.discourse.group/u/linwaytin)\
**Post date:** [June 1, 2025, 4:47am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/19 "2025-06-01T04:47:26Z")

</div>

You can also consider FLTK. There is a C binding library [GitHub - MoAlyousef/cfltk: C Bindings for FLTK](https://github.com/MoAlyousef/cfltk)

---

<div class="post-metadata">

**Author:** ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)\
**Post date:** [June 1, 2025, 9:33am UTC](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822/20 "2025-06-01T09:33:12Z")

</div>

Thank you all for your expert advice.  
I tried most of the options with varying degrees of success.  
Now I’m trying Microsoft’s MFC with Visual Studio. I know, it’s MS only, and I suppose many of you hate MS, but for now it’s all I need and it saves me a lot of C++ programming.  
I’m not very proficient in C++ programming, and I don’t like it much (too many curly brackets and semi-colons 😀

Roger

[Next page](https://fortran-lang.discourse.group/t/gtk-qt-web-to-make-a-gui/9822.md?page=2)
