问题
I want a write a desktop application using GTKMM. I want the interface to be made of different panels like in Eclipse you have the Project Explorer, Console, Properties, etc. You should be able to drag the panels to change their position, close them and popout them (not sure if you can popout the panels in Eclipse but you can do it in Visual Studio).
I am using the word panels here as I am not sure what the right term is. I guess some call it dockable windows.
Any pointers on how this can be achieved in GTKMM?
回答1:
The term is "docking" widgets and the GDL Library is the easiest way to get started with that. You may have seen GDL in action in applications like Anjuta and Inkscape. The documentation isn't that great, but, the source code includes a sample app and once you get going with it it's not that hard.
Basically, you add your widgets to a DockItem
and those to a Dock
. You put a DockBar
somewhere in your application to which the docked items can be minimized. You can save and load the dock "layout" to XML files so that the user doesn't have to re-arrange the dock items every time they start the application.
来源:https://stackoverflow.com/questions/11628194/how-to-develop-interface-like-eclipse-using-gtk