Skip to content

Commit c00f346

Browse files
committed
deploy: 16cf1bf
1 parent cfc522f commit c00f346

6 files changed

+18
-18
lines changed

architecture.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ <h2 id="different-ideas-different-nature"><a class="header" href="#different-ide
237237
I have an interface with a numeric value and increment and decrement interactions, you will very easily
238238
guess I am talking about a counter interface.</p>
239239
<p>However, if I tell you I have an interface with two buttons and a number... It's quite trickier for you to guess the kind
240-
of interface I am talking about! It could be anything!</p>
240+
of interface I am talking about. It could be anything!</p>
241241
<p>This is because widgets are generally very generic and, therefore, more reusable. Most interfaces display a combination of
242242
familiar widgets—like buttons and numbers. In fact, users expect familiar widgets to always behave a certain way. If they
243243
don't behave properly, the interface will be unintuitive and have poor <a href="https://en.wikipedia.org/wiki/User_experience">user experience</a>.</p>

first-steps.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,19 @@ <h3 id="the-number"><a class="header" href="#the-number">The Number</a></h3>
300300
<h3 id="the-layout"><a class="header" href="#the-layout">The Layout</a></h3>
301301
<p>Alright! We have our two buttons in <code>increment</code> and <code>decrement</code>, and our counter value in <code>counter</code>. That should be everything, right?</p>
302302
<p>Not so fast! The widgets in our counter interface are displayed in a specific <strong>order</strong>. Given our three widgets, there is a total of
303-
<strong>six</strong> different ways to order them! However, the order we want is: <code>increment</code>, <code>counter</code>, and <code>decrement</code>.</p>
303+
<strong>six</strong> different ways to order them. However, the order we want is: <code>increment</code>, <code>counter</code>, and <code>decrement</code>.</p>
304304
<p>A very simple way of describing this order is to create a list with our widgets:</p>
305305
<pre><code class="language-rust ignore">let interface = vec![increment, counter, decrement];</code></pre>
306306
<p>But we are still missing something! It's not only the order that is specific, our interface also has a specific visual <strong>layout</strong>.</p>
307307
<p>The widgets are positioned on top of each other, but they could very well be positioned from left to right instead. There is nothing
308308
in our description so far that talks about the <strong>layout</strong> of our widgets.</p>
309309
<p>In iced, layout is described using... well, more widgets! That's right. Not all widgets produce visual results directly; some may simply
310-
manage the position of existing widgets. And since widgets are just values, they can be nested and composed nicely!</p>
310+
manage the position of existing widgets. And since widgets are just values, they can be nested and composed nicely.</p>
311311
<p>The kind of vertical layout that we need for our counter can be achieved with the <code>column</code> widget:</p>
312312
<pre><code class="language-rust ignore">use iced::widget::column;
313313

314314
let interface = column![increment, counter, decrement];</code></pre>
315-
<p>This is very similar to our previous snippet! iced provides a <code>column!</code> macro for creating a <code>column</code> out of some widgets in a particular
315+
<p>This is very similar to our previous snippet. iced provides a <code>column!</code> macro for creating a <code>column</code> out of some widgets in a particular
316316
<strong>order</strong>—analogous to <code>vec!</code>.</p>
317317
<h3 id="the-interactions"><a class="header" href="#the-interactions">The Interactions</a></h3>
318318
<p>At this point, we have in our <code>interface</code> variable a <code>column</code> representing our counter interface. But if we actually tried to run it,
@@ -327,7 +327,7 @@ <h3 id="the-interactions"><a class="header" href="#the-interactions">The Interac
327327

328328
let increment = button("+").on_press(Message::Increment);
329329
let decrement = button("-").on_press(Message::Decrement);</code></pre>
330-
<p>Awesome! Our interactions are wired up! But there is still a small detail left. A button can be pressed multiple times. Therefore,
330+
<p>Awesome! Our interactions are wired up. But there is still a small detail left. A button can be pressed multiple times. Therefore,
331331
the same button may need to produce multiple instances of the same <code>Message</code>. As a result, we need our <code>Message</code> type to be cloneable.</p>
332332
<p>We can easily <em>derive</em> the <code>Clone</code> trait—as well as <code>Debug</code> and <code>Copy</code> for good measure:</p>
333333
<pre><code class="language-rust">#[derive(Debug, Clone, Copy)]
@@ -427,7 +427,7 @@ <h3 id="the-view"><a class="header" href="#the-view">The View</a></h3>
427427
<p>That's much more concise. It even resembles the actual interface! Since creating widgets just yields values with no
428428
side effects; we can move things around in our view logic without worrying about breaking other stuff. No spooky
429429
action at a distance!</p>
430-
<p>And that's all there is to our counter interface! I am sure you can't wait to <strong>run</strong> it. Shall we?</p>
430+
<p>And that's all there is to our counter interface. I am sure you can't wait to <strong>run</strong> it. Shall we?</p>
431431

432432
</main>
433433

print.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ <h2 id="different-ideas-different-nature"><a class="header" href="#different-ide
249249
I have an interface with a numeric value and increment and decrement interactions, you will very easily
250250
guess I am talking about a counter interface.</p>
251251
<p>However, if I tell you I have an interface with two buttons and a number... It's quite trickier for you to guess the kind
252-
of interface I am talking about! It could be anything!</p>
252+
of interface I am talking about. It could be anything!</p>
253253
<p>This is because widgets are generally very generic and, therefore, more reusable. Most interfaces display a combination of
254254
familiar widgets—like buttons and numbers. In fact, users expect familiar widgets to always behave a certain way. If they
255255
don't behave properly, the interface will be unintuitive and have poor <a href="https://en.wikipedia.org/wiki/User_experience">user experience</a>.</p>
@@ -413,19 +413,19 @@ <h3 id="the-number"><a class="header" href="#the-number">The Number</a></h3>
413413
<h3 id="the-layout"><a class="header" href="#the-layout">The Layout</a></h3>
414414
<p>Alright! We have our two buttons in <code>increment</code> and <code>decrement</code>, and our counter value in <code>counter</code>. That should be everything, right?</p>
415415
<p>Not so fast! The widgets in our counter interface are displayed in a specific <strong>order</strong>. Given our three widgets, there is a total of
416-
<strong>six</strong> different ways to order them! However, the order we want is: <code>increment</code>, <code>counter</code>, and <code>decrement</code>.</p>
416+
<strong>six</strong> different ways to order them. However, the order we want is: <code>increment</code>, <code>counter</code>, and <code>decrement</code>.</p>
417417
<p>A very simple way of describing this order is to create a list with our widgets:</p>
418418
<pre><code class="language-rust ignore">let interface = vec![increment, counter, decrement];</code></pre>
419419
<p>But we are still missing something! It's not only the order that is specific, our interface also has a specific visual <strong>layout</strong>.</p>
420420
<p>The widgets are positioned on top of each other, but they could very well be positioned from left to right instead. There is nothing
421421
in our description so far that talks about the <strong>layout</strong> of our widgets.</p>
422422
<p>In iced, layout is described using... well, more widgets! That's right. Not all widgets produce visual results directly; some may simply
423-
manage the position of existing widgets. And since widgets are just values, they can be nested and composed nicely!</p>
423+
manage the position of existing widgets. And since widgets are just values, they can be nested and composed nicely.</p>
424424
<p>The kind of vertical layout that we need for our counter can be achieved with the <code>column</code> widget:</p>
425425
<pre><code class="language-rust ignore">use iced::widget::column;
426426

427427
let interface = column![increment, counter, decrement];</code></pre>
428-
<p>This is very similar to our previous snippet! iced provides a <code>column!</code> macro for creating a <code>column</code> out of some widgets in a particular
428+
<p>This is very similar to our previous snippet. iced provides a <code>column!</code> macro for creating a <code>column</code> out of some widgets in a particular
429429
<strong>order</strong>—analogous to <code>vec!</code>.</p>
430430
<h3 id="the-interactions"><a class="header" href="#the-interactions">The Interactions</a></h3>
431431
<p>At this point, we have in our <code>interface</code> variable a <code>column</code> representing our counter interface. But if we actually tried to run it,
@@ -440,7 +440,7 @@ <h3 id="the-interactions"><a class="header" href="#the-interactions">The Interac
440440

441441
let increment = button("+").on_press(Message::Increment);
442442
let decrement = button("-").on_press(Message::Decrement);</code></pre>
443-
<p>Awesome! Our interactions are wired up! But there is still a small detail left. A button can be pressed multiple times. Therefore,
443+
<p>Awesome! Our interactions are wired up. But there is still a small detail left. A button can be pressed multiple times. Therefore,
444444
the same button may need to produce multiple instances of the same <code>Message</code>. As a result, we need our <code>Message</code> type to be cloneable.</p>
445445
<p>We can easily <em>derive</em> the <code>Clone</code> trait—as well as <code>Debug</code> and <code>Copy</code> for good measure:</p>
446446
<pre><code class="language-rust">#[derive(Debug, Clone, Copy)]
@@ -540,7 +540,7 @@ <h3 id="the-view"><a class="header" href="#the-view">The View</a></h3>
540540
<p>That's much more concise. It even resembles the actual interface! Since creating widgets just yields values with no
541541
side effects; we can move things around in our view logic without worrying about breaking other stuff. No spooky
542542
action at a distance!</p>
543-
<p>And that's all there is to our counter interface! I am sure you can't wait to <strong>run</strong> it. Shall we?</p>
543+
<p>And that's all there is to our counter interface. I am sure you can't wait to <strong>run</strong> it. Shall we?</p>
544544
<div style="break-before: page; page-break-before: always;"></div><blockquote>
545545
<p>This chapter documents <a href="https://github.com/iced-rs/iced/tree/eb67aa5d71172569e3d404107a1a449998d98d42">a revision of iced</a> not yet officially released. If you enjoy living on the edge,
546546
you can directly rely on this revision in your <code>Cargo.toml</code>:</p>
@@ -580,7 +580,7 @@ <h2 id="a-magical-runtime"><a class="header" href="#a-magical-runtime">A Magical
580580

581581
assert_eq!(counter.value, 1);
582582
}</code></pre>
583-
<p>This is technically a very bare-bones runtime! It initializes the <strong>state</strong>, produces some <strong>interactions</strong>,
583+
<p>This is technically a very bare-bones runtime. It initializes the <strong>state</strong>, produces some <strong>interactions</strong>,
584584
and executes the <strong>update logic</strong>.</p>
585585
<p>Of course, the interactions are made up, it is very short-lived, and there is no <strong>view logic</strong>
586586
involved—far from what we actually want. Still, it's a great start! Let's try to extend it, step by step.</p>
@@ -619,7 +619,7 @@ <h3 id="displaying-the-interface"><a class="header" href="#displaying-the-interf
619619
<p>See? Easy! Jokes aside, the purpose of this chapter is not for us to learn graphics programming; but for us
620620
to get a better understanding of how a runtime works. A little bit of magic doesn't hurt!</p>
621621
<h3 id="gathering-the-interactions"><a class="header" href="#gathering-the-interactions">Gathering the Interactions</a></h3>
622-
<p>The user is seeing our interface and is now interacting with it! We need to pay very good attention to all
622+
<p>The user is seeing our interface and is now interacting with it. We need to pay very good attention to all
623623
the interactions and produce all the relevant <strong>messages</strong> that our widgets specify.</p>
624624
<p>How? With some more magic, of course! I just found this <code>interact</code> function inside of my top hat—it takes an
625625
interface and produces the <strong>messages</strong> that correspond to the latest interactions of the user.</p>

searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

+1-1
Large diffs are not rendered by default.

the-runtime.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ <h2 id="a-magical-runtime"><a class="header" href="#a-magical-runtime">A Magical
217217

218218
assert_eq!(counter.value, 1);
219219
}</code></pre>
220-
<p>This is technically a very bare-bones runtime! It initializes the <strong>state</strong>, produces some <strong>interactions</strong>,
220+
<p>This is technically a very bare-bones runtime. It initializes the <strong>state</strong>, produces some <strong>interactions</strong>,
221221
and executes the <strong>update logic</strong>.</p>
222222
<p>Of course, the interactions are made up, it is very short-lived, and there is no <strong>view logic</strong>
223223
involved—far from what we actually want. Still, it's a great start! Let's try to extend it, step by step.</p>
@@ -256,7 +256,7 @@ <h3 id="displaying-the-interface"><a class="header" href="#displaying-the-interf
256256
<p>See? Easy! Jokes aside, the purpose of this chapter is not for us to learn graphics programming; but for us
257257
to get a better understanding of how a runtime works. A little bit of magic doesn't hurt!</p>
258258
<h3 id="gathering-the-interactions"><a class="header" href="#gathering-the-interactions">Gathering the Interactions</a></h3>
259-
<p>The user is seeing our interface and is now interacting with it! We need to pay very good attention to all
259+
<p>The user is seeing our interface and is now interacting with it. We need to pay very good attention to all
260260
the interactions and produce all the relevant <strong>messages</strong> that our widgets specify.</p>
261261
<p>How? With some more magic, of course! I just found this <code>interact</code> function inside of my top hat—it takes an
262262
interface and produces the <strong>messages</strong> that correspond to the latest interactions of the user.</p>

0 commit comments

Comments
 (0)