|
34.
|
|
|
Make sure you save the file in <application>Glade</application>, or your changes won't be kept! Then run the application from the terminal again. The window now has a place where the user can type.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:104(para)
|
|
35.
|
|
|
Now we'll add the entry field for the title and also a label for it. We'll use the top empty slot for that. First, click on "Horizontal Box" (HBox) from the "Containers" section of the toolbox, and then click on the top slot. A dialog box will open; tell it that you want two items.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:108(para)
|
|
36.
|
|
|
The HBox is a container that arranges its contents horizontally. Add a Label to the empty left hand box, and a Text Entry to the right hand one.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:112(para)
|
|
37.
|
|
|
Before going on, let's clean up the UI just a tad here. Select the new HBox from the list on the right. Then go to the Packing tab in the bottom right, and set Expand and Fill to "No".
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:116(para)
|
|
38.
|
|
|
Go to the General tab, and set spacing to 6.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:120(para)
|
|
39.
|
|
|
Select the label. On the General tab, set the Label field to "Name:". Set Expand and Fill to "No" for the label, but keep them as "Yes" for the entry. Set the Padding for both to 6 (also on the Packing tab).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:124(para)
|
|
40.
|
|
|
Add the Save, Open, and New Features
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:128(title)
|
|
41.
|
|
|
<placeholder-1/> After the user types something, they may want to save it. A File->Save menu item was automatically created when the empty applicaton was created, but it's not hooked up to any code. To make Save work, we need tell the menu item what function to call and then create a function to actually do the saving.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:128(para)
|
|
42.
|
|
|
Set the Signal Handler in <application>Glade</application>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:130(title)
|
|
43.
|
|
|
<placeholder-1/> First, we need to tell the menu item what function to call. If <application>Glade</application> is not still open, open up the application in <application>Glade</application>:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
data/templates/ubuntu-application/help/tutorial.xml:130(para)
|