I’m using Monodevelop to build a GUI. I already have a bunch of widgets nested within a HBox which is contained within the MainWindow. However, now I release I need to add a VBox to position the menu bar at the top. My question is how, in MonoDevelop, can I add the VBox as the parent on the existing HBox?
Simply dragging a VBox onto the window doesn’t do anything and I can’t find a menu option.
You can do that by creating the HBox (and potentially also the VBox) in code, as opposed to in the graphic designer.
For example:
If the HBox is already created in the graphic designer and you don’t wish to re-create it on the fly this way, than adjust the code accordingly. For example, if your already existing HBox name is hb, do the following:
Of course that means you will have to add all the menu items to VBox in code as well, but that is very easy, following the same rules. If you are not sure what member functions are available to you and how to use it, just create a new project, design the menu in the designer (using the VBox) and save. Now check the files under the folder gtk-gui, the file with the same name as your main code file (where the menu was placed) will have the exact code you need to re-create it in the original project
Hope that helps!