Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Hello World Example #2434

Closed
wants to merge 2 commits into from
Closed

Simple Hello World Example #2434

wants to merge 2 commits into from

Conversation

s4Dt0y
Copy link

@s4Dt0y s4Dt0y commented May 10, 2024

I was just looking through the examples and saw that there was no hello world example. Thought I'd see whether ygs would take one if I made it.

use iced::Element;

fn main() -> iced::Result {
iced::program("Hello - Iced", HelloIced::update, HelloIced::view).run()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not a maintainer or anything, but it would seem much more beneficial for a 'hello world' example to just have the default boiler plate code. Since no iced programs would ever be built like this, it seems sort of... strange?

Like a beginner at a rust, and iced would be confused on how to actually do something in the 'update' function. And why their program looks so different compared to everyone else's if they are seeking help.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple examples are essential for any lib, it's extremely bad to get super complex examples when you're a beginner, it's cool to see something simple and actually understand how it works, when the example is complicated you need to spend a certain amount of time trying to understand how it works , what each thing does, etc., it's great to have more usable examples, but simple, straight-to-the-point examples are essential, especially for new audiences.

A while ago I sent a PR to keyed_column, still hoping to get it merged haha.

#2361

@hecrj
Copy link
Member

hecrj commented Sep 10, 2024

Thanks! But the counter is what we consider a "Hello, world!" example since it showcases interactions; which are a key part of a user interface.

The API reference of run also includes a simpler version of the counter.

@hecrj hecrj closed this Sep 10, 2024
@hecrj hecrj added this to the 0.13 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants