Mono: Use glade to design the interface
Monodevelop does not have any interface design tools, but you can design the interface through glade, and then write code in monodevelop. Developing the glade program using monodevelop is very simple and convenient.
First, create a glade solution:
Figure 2.4.0
Open the glade program, select new GTK + project, and design our program interface:
Figure 2.4.1
Only one window (window1) and one button (button1) are designed here. window1 has a delete_event event and button1 has a clicked event.
Figure 2.4.2
Save the file to the directory of the newly created Project to overwrite the GUI. Glade file.
Modify the main. CS file because we need to control button1 in the program, so we added the button1 declaration,
[Glade. widget]
Button button1;
The window1 statement is also added here.
Because we set two events in the design interface, we add two event handling methods to the program.
Figure 2.4.3
Compile the program by pressing F8 and run the program in the terminal:
Figure 2.4.4
C # class library development will not be explained in a single chapter. Because it is too simple, it is nothing more than developing a class library for other programs to call. Don't tell me what a class library is.