Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI 0.11
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Forks
Kayak UI 0.11
Commits
ffab9e94
Unverified
Commit
ffab9e94
authored
2 years ago
by
John
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #199 from johanhelsing/patch-3
docs: Fix build errors in example chapter 3
parents
3a7933f3
d1ed7b69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
book/src/chapter_3.md
+6
-4
6 additions, 4 deletions
book/src/chapter_3.md
with
6 additions
and
4 deletions
book/src/chapter_3.md
+
6
−
4
View file @
ffab9e94
...
...
@@ -12,7 +12,7 @@ I think it's best if we showcase a simple example:
// This is because we need to diff the previous values of these.
// Default is used to make creating widgets a little easier.
// And component is required since this is a bevy component!
[
#
derive
(
Component
,
Clone
,
PartialEq
,
Default
)]
#
[
derive(Component,
Clone,
PartialEq,
Default)]
pub
struct
MyButtonProps
{
}
...
...
@@ -76,13 +76,15 @@ pub fn my_button_render(
..
Default
::
default
()
};
let
parent_id
=
Some
(
entity
);
rsx!
{
<
BackgroundBundle
styles
=
{
background_styles
}
// We pass the children to the background bundle!
children
=
{
children
.clone
()}
/>
}
}
;
}
// The boolean returned here tells kayak UI to update the tree. You can avoid tree updates by
...
...
@@ -99,10 +101,10 @@ fn startup(...) {
// We need to register the prop and state types.
// State is empty so you can use the `EmptyState` component!
context
.add_widget_data
::
<
MyButtonProps
,
EmptyState
>
();
widget_
context
.add_widget_data
::
<
MyButtonProps
,
EmptyState
>
();
// Next we need to add the systems
context
.add_widget_system
(
widget_
context
.add_widget_system
(
// We are registering these systems with a specific WidgetName.
MyButtonProps
::
default
()
.get_name
(),
// widget_update auto diffs props and state.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment