6 ms·
I've used it in production code for the last 10 years. Used in both C++ and Python flavors of the lib ... works great!
by kelvin0 11y ago
I've used it in production code for the last 10 years. Used in both C++ and Python flavors of the lib ... works great!
- tonyedgecombe 11y agoI have too but I don't like it and feel I would have been better off with qt.
- dekhn 11y agoYup. WxWidgets was probably the least useful graphical development environment I have used. In particular, many of the GUI elements don't expose their inner widgets. For example, when I used it, I wanted to change the font of a label in a tabbed window. The tabbed window widget provided no access to the font object at the C++ level- I suppose you could subclass, but that wouldn't propagate tot he Python generated classes. You're better off just using qt: they put a lot more work into making it a useful environment, it runs a lot more places.
- chrisseaton 11y ago> In particular, many of the GUI elements don't expose their inner widgets But you know why, right? It's because it's supposed to be both cross-platform and native, so a particular platform may not use a nested label widget in a tabbed window, so it can't give you such an object.
- dekhn 11y agoall the native platforms that qt supports support nested label widgets. the wx class has that member variable, it's just private with no accessor.
- chrisseaton 11y agoMaybe my information is out of date, but I didn't think Qt supports any platforms natively at all. So Qt can give you a label widget, because it's creating the controls itself. They aren't really native controls. If you look at the Windows implementation for the wxNotebook (which I guess is the class you mean), you can see it doesn't use a nested widget for the tab label. The field may exist, but this implementation doesn't use it and instead it uses standard Windows API calls like TabCtrl_SetItem, which doesn't allow you to set a font. It only allows you to pass in a char* string. https://github.com/wxWidgets/wxWidgets/blob/master/src/msw/notebook.cpp#L389-L413 https://github.com/wxWidgets/wxWidgets/blob/master/src/msw/n... https://msdn.microsoft.com/en-us/library/windows/desktop/bb760554(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb7... So on Windows what do you expect it to give you if you ask for the label widget if there isn't one? Pretend there is one and give you some kind of facade object? What should happen if you try to set the font? Since the API they're using just doesn't support it. I think the Windows API may allow you to subclass a tab to draw it yourself and use fonts, but that's asking a lot. And there still isn't really any label widget for them to return even if they did that!
- dekhn 11y agoYes,you are correct: Qt uses themes and styles to configure its internally rendered widgets so they appear native. http://doc.qt.io/qt-4.8/style-reference.html http://doc.qt.io/qt-4.8/style-reference.html In the case of windows, you can either use the char * methods, or you have an owner-controlled widget which is a rendering area. That's what Qt does. Combined with Qt's windows style, you get somethign that looks native by default, but is customizable. This seems to me to be a far more productive approach that trying to come up with an API that supports only the common subset of features shared between Apple's UI toolkit, Windows UI toolkit, and Linux. Note that qt also supports embedded devices with raw frame buffers; you can make a UI that looks nearly pixel identical to Windows on that platform.
- chrisseaton 11y ago> This seems to me to be a far more productive approach that trying to come up with an API that supports only the common subset of features shared between Apple's UI toolkit, Windows UI toolkit, and Linux. But an API with the common subset of features is the whole philosophical point of wx! If you're going to criticise them for that you might as well criticise screwdrivers for turning screws. That's what they were built for.
- mwcampbell 11y agoWhy would you actually want to change the font of a label on a tab? Wouldn't that make your application inconsistent with the host platform?
- dekhn 11y agoIn my case, I wanted to bold the font when an activity occurred there, so a user would know to navigate to that tab. I don't particularly care about the host platform; I write software that runs on all 3 major platforms, and having it behave mostly-consistently across the platforms is more important than being consistent with the host platform.
- eco 11y agoYour example kind of reflects that you aren't using wx for what it's made for. You can usually call GetHandle() and switch to platform specific stuff if you need to do something weird like that. I wouldn't really recommend that though. The point of wxWidgets isn't to be the most flexible GUI framework. It's to be as consistent and native as it can be across many platforms. If you need to do weird things in a non-native way then wx probably isn't for you. If you want to write software that looks and feels like a native application (because it is) then wx is your best bet. Qt is great but I've never used Qt application that felt like a native application. Also, Qt is rather expensive for commercial projects (about $4k per year per developer).
- tonyedgecombe 11y agoQt is published under LGPL, you don't need to spend £4k for a commercial application.
- dbcurtis 11y agoFor someone trying to decide which to use, can explain why?
- zura 11y agoSame here, although with C++ only. And still continuing using it.