|
7.
|
|
|
Have you taken <link xref="hellognome.js">the first tutorial in this series</link> already? You'll want to do so before continuing.
|
|
|
(itstool) path: note/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:26
|
|
8.
|
|
|
Going native
|
|
|
(itstool) path: section/title
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:32
|
|
9.
|
|
|
In the last tutorial, we created what was basically a GNOME window frame for a web app. All the GNOME-specific code we needed to learn revolved around putting the WebView -- the widget containing our application -- into an ApplicationWindow, and telling it to display. The application itself was written in HTML and JavaScript, just like most pages on the web.
|
|
|
(itstool) path: section/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:34
|
|
10.
|
|
|
This time, we're going to use only native GNOME widgets. A widget is just a thing, like a checkbox or picture, and GNOME has a wide variety of them to choose from. We call them "native" widgets to distinguish them from things like the button and header in the web app we wrote. Because instead of using web code, these are going to be 100 percent GNOME, using GTK+.
|
|
|
(itstool) path: section/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:35
|
|
11.
|
|
|
GTK+ stands for "GIMP Toolkit". It's like a toolbox of widgets that you can reach into, while building your applications. It was originally written for <link href="http://www.gimp.org/">the GIMP</link>, which is a free software image editor.
|
|
|
(itstool) path: note/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:36
|
|
12.
|
|
|
Setting up our application
|
|
|
(itstool) path: section/title
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:40
|
|
13.
|
|
|
Before we dig out any widgets from the GTK+ toolbox, we first need to write the basic boilerplate code that our application requires.
|
|
|
(itstool) path: section/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:42
|
|
14.
|
|
|
|
|
|
(itstool) path: section/code
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:43
|
|
15.
|
|
|
This part always goes at the start of your code. Depending on what you'll be doing with it, you may want to declare more imports here. What we're writing today is pretty basic, so these are all we need; Gtk for the widgets, using the stable '3.0' API.
|
|
|
(itstool) path: section/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:49
|
|
16.
|
|
|
Speaking of which:
|
|
|
(itstool) path: section/p
|
|
|
|
(no translation yet)
|
|
|
|
Located in
C/02_welcome_to_the_grid.js.page:50
|