Hi all,

Perhaps a stupid question. Some time ago, I received a rpi zeroW as a gift, but as I did not have any use for ii I passed it to somebody else in our electronics-group. Now, that person has had a +30 year carreer as self-taught programmer -starting out with BASIC on DOS machines- so he showed of some of his old BASIC applications in dosbox on the pi.

So far so good, but he had an interesting question: Years ago, I wrote a library in BASIC for screen / window applications in DOS. (you know, pop-up text-windows and so on). How do I do that on linux (in C)?

As I myself only do ‘backend’ coding (so no UI), I have to admit I did not have any answer to that.

So, question, For somebody who has mostly coded in BASIC (first DOS and later Visual Basic) and now switched to C and python, what is the best / most easy tool to write a basic UI application with window-function on linux/unix. I know there exist things like QT and ncurses, but I never used these, so I have no idea.

Any advice?

Kr.

  • @INeedMana
    link
    193 months ago

    wrote a library in BASIC for screen / window applications in DOS. (you know, pop-up text-windows and so on). How do I do that on linux (in C)?
    (…)
    I know there exist things like QT and ncurses

    So it’s graphical interface we are after or text based?

    For text, I agree with others, ncurses

    For graphical

    • pyGTK
      basically everything you need, some learnig curve as it’s big and versatile. But to be honest, when trying to achieve something I’d suggest to start from GTK reference to me it somehow conveys the logic better than the PyGTK reference
    • Kivy
      haven’t used it, but might be fun to use
    • wxWidgets
      very cross-platform. Not only you can use it to write UI that will require minor fixes to have the same code for Windows and Linux at the same time, you can also tell it whether the toolkit used under the hood on Linux should be QT or GTK
    • Tk
      old, simple (more fancy things need some gymnastics) but simple (easy to use) and supported in Python out of the box (you don’t even need to install anything)
    • QT
      I’m putting it here just for fairness. I don’t like it, don’t like its signal-slot design, I think it’s hogging up too much resources. But last time I used it was ~10 years ago and in the end, it does in fact work
    • @[email protected]OP
      link
      fedilink
      73 months ago

      Wauw! So many answers in such a short time. Thanks all! 👍 (I will not spam the channel by sending a thank you to all but this is really greatly apriciated)

      Concerning ncurses. I did hear of it but never looked at it myself. What is not completely clear for me. I know you can use it for ‘low-level’ things, but does it also include ‘high-level’ concepts like windows, input fields and so?

      The blog mentioned in one of the other posts only shows low-level things.

      • @[email protected]
        link
        fedilink
        33 months ago

        but does it also include ‘high-level’ concepts like windows, input fields and so

        Yes, it allows you build full on TUIs.

      • @INeedMana
        link
        13 months ago

        does it also include ‘high-level’ concepts like windows, input fields and so?

        AFAIK MC uses ncurses for GUI. So I while I don’t know if it has the concept of non-modal dialog, for example, for sure it has dialogs, fields, radios, boxes, etc