4

I'am writing with my friends a simple photo viewer in C++ using gtkmm. Everything goes quite well, except that our app is looking very poor and completely diffrent from any other GTK+ application on ours Linux desktops. If anyone could give us some advice about what are we doing wrong, we will be very grateful.

Code responsible for creating the window is here (the rest is in the repository): https://github.com/jjkrol/ZPR/blob/master/src/gui.cpp

Screenshot with the look:
Screenshot with the look

Any help would be apprecieated, thanks in advance!

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
mc.suchecki
  • 1,898
  • 4
  • 23
  • 44
  • Regarding the SCons performance, the SConstruct looks ok. Try compiling the file that takes so long "by hand" by copying and pasting the compilation command to isolate if its the compiler or SCons. – Brady Mar 24 '12 at 16:49

1 Answers1

5

GTK 3.0 has a different theming than GTK 2.0. Probably any of your other GTK+ applications still depend on 2.0 so you don't have set a theme for 3.0. Find out how to set it to e.g. Adwaita in your desktop environment.

Btw: have a look at Glib::RefPtr<>.

ipc
  • 8,045
  • 29
  • 33
  • Thank you very much, it worked! Why you suggest taking a look at `Glib::RefPtr<>`? Am I using it wrong? – mc.suchecki Mar 24 '12 at 00:07
  • 2
    I believe he's referring to the preponderance of "new" in your code. In gtkmm code, you should either declare the field directly (Gtk::Box mybox) so there are no exposed pointers or if that isn't possible, use a Glib::RefPtr<> (Glib::RefPtr mybox) so that the new'd pointers are harder to leak. In either case the objects are deleted automatically. Gtk::manage is also useful at times, you should be aware of it as well. – ergosys Mar 24 '12 at 04:26
  • 2
    No, do not use RefPtr with widgets. It's not meant for that and will lead to problems. Use Gtk::manage(). – murrayc Apr 21 '12 at 14:44
  • I'm using KDE (plasma) - no idea how to set a 'gtkmm3 theme' on it :/. – Carlo Wood Aug 10 '20 at 20:50