[haiku-development] Re: Haiku "Hello, World" tutorial

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 14 Sep 2009 18:34:41 -0400

On Mon, Sep 14, 2009 at 4:12 PM, Rob Hoelz <rob@xxxxxxxxxxx> wrote:
> I just finished an article on writing a simple "Hello, World"
> application for Haiku, and I'd like anyone with a spare minute of time
> to take a look if they could.  I'd appreciate any comments, complaints,
> suggestions, or corrections you could offer me!

I think it looks pretty good! You've covered all the bases pretty well
for a basic application with a window.

Some suggestions:

- Generally we use cpp as the extension for C++ files, though each
developer is free to use whatever they like obviously.
- The view you add the button to does not strictly need the
B_WILL_DRAW flag, but it doesn't hurt to have it.
- Using be_app_messenger.SendMessage(B_QUIT_REQUESTED) to quit the app
is fine, but I generally see be_app->PostMessage(B_QUIT_REQUESTED)
instead. I'm not sure why the latter is the more common idiom
(especially since it is less safe), it just seems to be. Maybe another
developer can enlighten us as to why that might be. You'd be fine to
leave it as is though.
- For this demo what you have is fine, but for anything more complex
you should look at using the layout system. Here is my old article on
it:

http://www.haiku-os.org/documents/dev/laying_it_all_out_part_1

Someday I'll get around to part 2 ;)

Also in future articles you could talking about using the
makefile-engine or Jamfile-engine to build Haiku apps.

-- 
Regards,
Ryan

Other related posts: