GUI/TUI linux library

前端 未结 8 1214
别那么骄傲
别那么骄傲 2020-12-30 14:01

Is there any UI library that can be to build both a text user interface (ncurses) and graphical user interface (GTK? QT?) from the same source? I know that debconf can be us

相关标签:
8条回答
  • 2020-12-30 14:23

    Not exactly a library but you could consider writing a web app that degrades well to Lynx

    0 讨论(0)
  • 2020-12-30 14:23

    By using a library that targets both the text-mode and GUI environments, you have a big risk of getting stuck with the worst of both worlds.

    You will be better off structuring your code using the MVC pattern, and providing separate views and controllers for each platform you target. Pushing all the logic down to the model classes has several other benefits:

    • The code will be easier to test because you are forced to keep the user interface out of the actual domain logic.
    • Your program can have user interfaces that have very little in common, e.g. a web UI, or an UI driven by speech.
    • You can run the program easily with no UI at all (i.e. script it) by accessing the model classes directly in the same way that the controller classes do.
    0 讨论(0)
提交回复
热议问题