A dialog box opens on ‘+’

First thing being adding a selector to the treeview by clicking on ‘+’ at the bottom, the signal emitted by clicking the button was connected to a function, its so called slot. Clicking this button now opens up a dialog box which contains an entry box in it.

Entry box is a single line text edit field. Adding it to the dialog box posed issues like:

Gtk-WARNING **: Attempting to add a widget with type gtkmmGtkEntry to a gtkmmGtkDialog, but as a GtkBin subclass a gtkmm__GtkDialog can only contain one widget at a time; it already contains a widget of type GtkVBox

I added a Gtk::VBox to the dialog, then added the entry box to this vertical box and I got the warning emphasized above. Nothing showed up in the dialog box. Empty. After struggling quite some time to solve this issue, I studied the source file of Dialog class. Some answers online showed usage of get_content_area() which however does not exist for the Dialog class now.

Studying its source file, the cause of the warning showed up. getVBox() is a function of the Dialog class, entailing the fact that it already has one. Solved the issue and added entry widget to the dialog. Besides, I added a button clicking which a selector with name equal to text in entry box will be added to the treeview of the style dialog.

Screenshot from 2016-06-06 23:39:26

Leave a Reply