+ 3 - 6 | § ¶Glade 3 in MonoDevelop
I've been playing lately with Glade 3. What's interesting about this (still in the works) new Glade is that all the widgets that compose the Glade GUI are available in a separate library (libgladeui), which means that Glade can now be easily integrated in other applications. And of course MonoDevelop is a good candidate for this.The first step has been to create bindings for libgladeui. Those bindings are available in the gladeui-sharp module of Mono SVN, and they are not complete, but enough to make they work in Mono.
Next step: integrate the Glade widgets into MD. Creating the add-in, and adding the 3 new pads (the project view, the property editor, and the widget palette) is easy. The only window that can't be integrated is the the form editor, which is always created as a top level window and this can't be changed (as of now). However, I believe that only integrating those widgets is not enough. What would be really useful is a more deep integration between the windows being edited with Glade, and the C# classes that represent those windows. This is what I have in mind:
- When a new window or dialog is created, a new class with the same name is added to the project.
- The Glade project view shows a list of all windows in the active
project. If there is more than one glade file in a project, it could show a
combo for selecting which file you want to work on.
- Clicking on a window opens that window for editing (in a top level window), and also opens the file that contains the corresponding class.
- When a signal handler is added to a widget, a handler method is created in the class.
- When clicking the "Add to Class" button in the property editor a new variable representing the widget will be added in the class.
- Renaming the window, a widget or a signal handler will update the corresponding class.
The hard part of all this is keeping the class and the window design in sync. We need some code generation features which are not present right now in MD, things like creating a new class, adding/renaming/deleting methods and fields from a class. My plan is to reuse some of the Refactoring work that was started, but I haven't got a chance to look at the code yet and see if it can be used for this.
Here is a screenshot of what I have for now. This is NOT YET in SVN, and won't be until it is rather useful:
