简体   繁体   中英

Small native cross-platform GUI framework for C++

I wrote a small program with Boost in c++. It works fine and so I want to give it a graphical interface so that it is easier to use.
In order to do so, I am looking for small cross-platform framework which provides native look and feel. Windows and Linux support would be enough, currently i do not need os x...

I used wxWidgets for some other project, but it was a pain to set everything up and ship this big library with the software.
But I was really amazed by the use of real native controls. In order to keep the program small I also tried fltk, but it has an awful look.

I just need an simple framework without network support or other gimmicks.

So my question: Is there any framework out there which fits all the requirements? Or if not, which frameworks fits at least some of these needs?

Thanks in advance!

When it has the word "framework" in its name it's almost never small.

Anyway, graphical frameworks/libraries tend to be big, cause they need to handle a lot of stuff.

Qt is probably the best straightforward library for cross-platform GUI, but it definitely doesn't constitute a "small framework". On the other hand, on Linux systems, Qt will be most likely already installed. Plus it definitely pays for its size.

wxwidgets is fairly small as far as gui toolkits go.

And it's cross platform

http://www.wxwidgets.org/

You have mentioned it, but as far as cross platform toolkits go it's one of the smallest I've seen.

The only other suggestion I have is that you could wrap your code up into a C library and link that into another language. eg Use .NET on windows and mono for linux or even a java based app (although they don't always look very native to the platform). Then use your library from there.

Ultimate++ might contain what you need. (Although they make it sound in the FAQ as if their library is really big, it doesn't seem that bad to me.)

别忘了检查一下果汁

Qt works amazingly, but is not very small. I've found there is a genuine lack of "small" cross-platform GUIs. You either might try to just abstract your GUI with #ifdefs all over the place, or use Qt/wx.

If you want it to be small, just write the GUI twice -- once in MFC and then in X. Your GUI sounds simple enough. Build up your own small abstraction that is just what you need.

Like others mentioned you cannot mix the "cross platform" and small in size in the same sentence.

More work, smaller in size: One solution I can suggest is to use native python binding for the UI portion. Since you are already using boost, it should be fairly trivial to have Boost.Python communicate between C++ space and python space. You already have python on Linux and its a 20-40MB package on Windows (can't remember how big the latest release is). But here you will have to use win32 binding on windows and gtk/qt bindings on linux, so more work. Nah, too much work to maintain, scratch this.

Moderate work, smaller in size but with non-native controls: You can try to get clutter or freeglut to get your UI work done but I personally haven't used them so I don't know if they provide full native looks for your apps. But they are small in size compared to wx or qt.

Less work, bigger in size: Use WxWidgets if you are already comfortable with it, otherwise I recommend Qt.

You can also have a look at some of the other offerings: http://en.wikipedia.org/wiki/List_of_widget_toolkits

Clutter: http://www.clutter-project.org/about FreeGLUT: http://freeglut.sourceforge.net

这里有大量的活跃和不活跃的跨平台C ++ UI库: https : //philippegroarke.com/posts/2018/c++_ui_solutions/其中一些很小,看起来很自然。

ever heard of QT ???

http://qt.nokia.com/products/

i think it should fits all your your needs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM