[haiku-3rdparty-dev] Re: hybrid native and Qt app

  • From: Rene Gollent <anevilyak@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Tue, 5 Mar 2013 08:11:06 -0500

On Tue, Mar 5, 2013 at 8:03 AM, hey68 you <hey68you@xxxxxxxxx> wrote:
> I don't quite understand what you mean about adding the BHandler to the
> BApplication Qt creates.  (When I tried to replace my BLooper object, with a
> BHandler it compiled, but I didn't get the messages).

BLoopers allow BHandlers to be attached to them to handle messages
[1]. This is also how BWindow/BView work (BWindow is a BLooper while
BView is a BHandler that gets attached to the window looper when you
add the view to the window). Once such a handler is attached, it can
also handle messages sent to that looper via its MessageReceived()
hook. So in this case, after you have your BHandler defined, you can
simply do be_app->AddHandler(yourHandler); to attach it to that
message loop.

Regards,

Rene

[1] 
http://www.haiku-os.org/legacy-docs/bebook/BLooper.html#BLooper_MemberFunctions

Other related posts: