The following example will explain how to handle 2 windows in an application.

The first window shows 2 labels, one with some text and the other blank, then a data entry field asking for the name, and 2 buttons, one to capture the text and one to exit. When you click the capture text button, another window opens asking whether you are sure about what you want to do; if you accept, the text is shown in the label.

The following figure shows the interface developed with glade.

Tutorial 4 Glade 1

The program code is the following:

Code

When the program runs, the following figure is shown:

Tutorial 4 Glade 2

Type the name and press capture text: Tutorial 4 Glade 3

When you press capture text, a window opens asking whether you want to accept or quit the application.

Tutorial 4 Glade 4

Finally, the captured text is shown in the label.

Tutorial 4 Glade 5

You can download the application code from github at the following link (broken link).

===

Make a donation! If you liked the article you can make a donation with Bitcoin (BTC) using the digital wallet of your choice to the following address: 17MtNybhdkA9GV3UNS6BTwPcuhjXoPrSzV

Or by scanning the QR code from your wallet:

17MtNybhdkA9GV3UNS6BTwPcuhjXoPrSzV