Is there a list of Gtk2 widgets? - gtk2

Is there a list of Gtk2 widgets along with screenshots or demonstrations somewhere? I want to find out what a widget is called.

You are looking for the widget gallery.
Also, there should be a demonstration program installed along with GTK; try running gtk-demo at your terminal (gtk3-demo for GTK 3.)

Related

How to put system icons in menus?

I have run the menu example from Qt and there are no icons on menus, only text. Most apps (like pcmanfm and caja from Ubuntu) have similar icons, so I suppose they are system-wide and not application specific. How could I put icons in menu items? A code sample would be interesting.
To obtain the icons of the systems you must use the method QIcon::fromTheme()
Example:
newAct = new QAction(tr("&New"), this);
newAct->setIcon(QIcon::fromTheme("document-new"));
Qt uses as a backend to freedesktop icon, it has a rule in the names, the updated list of them can be found in the following link
The QIcon::fromTheme() function found in the other answer is unfortunately not portable to Mac or windows. You may have better luck using QStyle::standardIcon().

display a bokeh graph in wxpython

can someone post an example to load a bokeh graph into wxpython gui (on Windows 7).
I tried following but wasn't able to see anything loaded.
https://groups.google.com/a/continuum.io/forum/#!topic/bokeh/8YqCZdRBgJs
Not directly. The bokeh project currently does not have a way to export the graphs as png or jpg files. See https://github.com/bokeh/bokeh/issues/538 for more information
Until this issue is formally resolved, you won't be able to show them inside of wxPython unless you use wxPython's webview widget. The webview widget is basically a wrapper around webkit (Linux / Mac) so theoretically you could use that to view a graph generated by bokeh.

How to add the OS X flavor to a Qt app

I have used Qt previously only in the form of PyQt, and today I tried the original version of Qt in C++.
I got it working, however, when if start up my app, I have several problems with it:
it's stationary, which means, I cannot drag it across the screen
I cannot change the size of the window
it does not have a OS X type status bar (which contains the three colored buttons and the name of the window)
How can I add these features to my C++ Qt app?
I have tried to look for a solution, but only found QtApplication::setStyle();, which did not solve my problem.
You can see the code here.
The code inside your subclass of QMainWindow contains this line:
setWindowFlags(Qt::FramelessWindowHint);
That is probably causing most of the problems you describe. Try removing that line.

Creating a tree-view with buttons? in QT

I am trying to make a dialog box like below in QT, the only problem is I have no idea what the widget is called. The bar on the left is like a tree-view widget, but when you click on it, it updates the text on the right. Does anybody happen to know what the widget is called or what widget(s) are required to perform this? I am using QT C++ on Windows.
There is an example with Qt showing you how to do this.
https://doc-snapshots.qt.io/4.8/dialogs-configdialog.html
If you're using Qt Creator as IDE, you can find it under the "Demos and Examples" tab in the Welcome Screen too.
It uses a QListWidget for the selector, and QStackedWidget to control the different pages. Connect the currentItemChanged signal of the list widget to change what page should be shown. Everything you'll need is in configdialog.cpp.
If you realy need to add QPushButton into QListWidget, use setItemWidget, or into ListView use QAbstractItemView::setIndexWidget

Subprocess as QT widget

I'm developing a simple IDE that has a embed, non-QT OpenGL renderer inside it. To prevent segfault's on the renderer to crash my application I'm willing to create it as a subprocess and somehow attach it as an widget on my QT main window. Is that possible?
Yes, you need to use QX11EmbedContainer in the main process, and then in another process to show your opengl widget.
QWinHost and related classes, now found in the QtSolutions archive, may be of help to you. You will find QWinHost in the qtwinmigrate plugin.
Don't be put off by the mention of "MFC support" - you can compile it without the AFXDLL dependencies as specified in the comments in qtwinmigrate.pri.