mirror of
https://github.com/ToshioCP/Gtk4-tutorial.git
synced 2025-01-11 20:03:35 +01:00
Fix source file typo errors.
This commit is contained in:
parent
e1a2119d1e
commit
0c1dd15314
5 changed files with 18 additions and 17 deletions
|
@ -209,9 +209,10 @@ explain that to you first.</p>
|
|||
<p>A signal is emitted when something happens. For example, a window is
|
||||
created, a window is destroyed and so on. The signal “activate” is
|
||||
emitted when the application is activated. (Activated is a bit different
|
||||
from started, but you can think of them both as almost the same so far.) If the
|
||||
signal is connected to a function, which is called a signal handler or
|
||||
simply handler, then the function is invoked when the signal emits.</p>
|
||||
from started, but you can think of them both as almost the same so far.)
|
||||
If the signal is connected to a function, which is called a signal
|
||||
handler or simply handler, then the function is invoked when the signal
|
||||
emits.</p>
|
||||
<p>The flow is like this:</p>
|
||||
<ol type="1">
|
||||
<li>Something happens.</li>
|
||||
|
@ -371,8 +372,8 @@ instance, you need to cast it.</p>
|
|||
<p>It works, but isn’t usually used. Instead, <code>GTK_WINDOW</code>
|
||||
macro is used.</p>
|
||||
<div class="sourceCode" id="cb16"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>GTK_WINDOW <span class="op">(</span>win<span class="op">)</span></span></code></pre></div>
|
||||
<p>The macro is recommended because it does not only cast the pointer but it also checks
|
||||
the type.</p>
|
||||
<p>The macro is recommended because it does not only cast the pointer
|
||||
but it also checks the type.</p>
|
||||
<h4 id="connect-it-to-gtkapplication.">Connect it to
|
||||
GtkApplication.</h4>
|
||||
<p>The function <code>gtk_window_set_application</code> is used to
|
||||
|
|
|
@ -114,7 +114,7 @@ So, I will explain that to you first.
|
|||
A signal is emitted when something happens.
|
||||
For example, a window is created, a window is destroyed and so on.
|
||||
The signal "activate" is emitted when the application is activated.
|
||||
(Activated is a bit different from started, but you can think the both are almost same so far.)
|
||||
(Activated is a bit different from started, but you can think of them both as almost the same so far.)
|
||||
If the signal is connected to a function, which is called a signal handler or
|
||||
simply handler, then the function is invoked when the signal emits.
|
||||
|
||||
|
@ -204,7 +204,7 @@ The parameters are:
|
|||
|
||||
- self is an instance to which the signal belongs.
|
||||
- user\_data is a data defined in the fourth argument of the `g_signal_connect` function.
|
||||
If it is NULL, then you can ignore and left out the second parameter.
|
||||
If it is NULL, then you can ignore and leave out the second parameter.
|
||||
|
||||
API reference manual is very important.
|
||||
You should see and understand it.
|
||||
|
@ -314,7 +314,7 @@ Instead, `GTK_WINDOW` macro is used.
|
|||
GTK_WINDOW (win)
|
||||
~~~
|
||||
|
||||
The macro is recommended because it does not only cast but also check the type.
|
||||
The macro is recommended because it does not only cast the pointer but it also checks the type.
|
||||
|
||||
#### Connect it to GtkApplication.
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ Then, these two buttons are appended to the box.
|
|||
10 }
|
||||
~~~
|
||||
|
||||
The function `gtk_button_get_lable` returns a text from the label.
|
||||
The function `gtk_button_get_label` returns a text from the label.
|
||||
The string is owned by the button and you can't modify or free it.
|
||||
The `const` qualifier is necessary for the string `s`.
|
||||
If you change the string, your compiler will give you a waring.
|
||||
|
@ -361,7 +361,7 @@ You always need to be careful with the const qualifier when you see the GTK 4 AP
|
|||
|
||||
![Screenshot of the box](../image/screenshot_lb4.png)
|
||||
|
||||
The handler corresponds to `btn1` toggles its label.
|
||||
The handler corresponds to `btn2` destroys the top-level window and the application quits.
|
||||
The handler corresponding to `btn1` toggles its label.
|
||||
The handler corresponding to `btn2` destroys the top-level window and the application quits.
|
||||
|
||||
Up: [README.md](../README.md), Prev: [Section 3](sec3.md), Next: [Section 5](sec5.md)
|
||||
|
|
|
@ -100,7 +100,7 @@ So, I will explain that to you first.
|
|||
A signal is emitted when something happens.
|
||||
For example, a window is created, a window is destroyed and so on.
|
||||
The signal "activate" is emitted when the application is activated.
|
||||
(Activated is a bit different from started, but you can think the both are almost same so far.)
|
||||
(Activated is a bit different from started, but you can think of them both as almost the same so far.)
|
||||
If the signal is connected to a function, which is called a signal handler or
|
||||
simply handler, then the function is invoked when the signal emits.
|
||||
|
||||
|
@ -172,7 +172,7 @@ The parameters are:
|
|||
|
||||
- self is an instance to which the signal belongs.
|
||||
- user\_data is a data defined in the fourth argument of the `g_signal_connect` function.
|
||||
If it is NULL, then you can ignore and left out the second parameter.
|
||||
If it is NULL, then you can ignore and leave out the second parameter.
|
||||
|
||||
API reference manual is very important.
|
||||
You should see and understand it.
|
||||
|
@ -275,7 +275,7 @@ Instead, `GTK_WINDOW` macro is used.
|
|||
GTK_WINDOW (win)
|
||||
~~~
|
||||
|
||||
The macro is recommended because it does not only cast but also check the type.
|
||||
The macro is recommended because it does not only cast the pointer but it also checks the type.
|
||||
|
||||
#### Connect it to GtkApplication.
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ Then, these two buttons are appended to the box.
|
|||
misc/lb4.c click1.cb
|
||||
@@@
|
||||
|
||||
The function `gtk_button_get_lable` returns a text from the label.
|
||||
The function `gtk_button_get_label` returns a text from the label.
|
||||
The string is owned by the button and you can't modify or free it.
|
||||
The `const` qualifier is necessary for the string `s`.
|
||||
If you change the string, your compiler will give you a waring.
|
||||
|
@ -171,5 +171,5 @@ You always need to be careful with the const qualifier when you see the GTK 4 AP
|
|||
|
||||
![Screenshot of the box](../image/screenshot_lb4.png){width=6.3cm height=5.325cm}
|
||||
|
||||
The handler corresponds to `btn1` toggles its label.
|
||||
The handler corresponds to `btn2` destroys the top-level window and the application quits.
|
||||
The handler corresponding to `btn1` toggles its label.
|
||||
The handler corresponding to `btn2` destroys the top-level window and the application quits.
|
||||
|
|
Loading…
Reference in a new issue