[haiku-development] A BMessage w/o a BApplication?

  • From: fano il primo <fanoilprimo@xxxxxxxxx>
  • To: haiku-development <haiku-development@xxxxxxxxxxxxx>
  • Date: Sun, 29 Jan 2012 13:54:15 +0100

Hy to all,
I'm studying BeOS/Haiku API and I've not understood well this thing... I
could have a BMessage without a BApplication? Without a BWindows to be more
precise?

Let see if I can do an example:

   - suppose I've a BApplication with its BWindow, its MessaageReceived()
   loop and so on..
   - suppose then I've to listen on a network port; the Haiku/BeOS coding
   guidelines requires I've TO DO a thread so the GUI is responsive while I'm
   processing network messages... suppose I've to send a message to the main
   application? I can SEND it? Maybe there's PostMessage that could do this
   work... but if I've to receive BMessage(s), too? I've no a MessageReceived
   funtion... so what?

I've looked in Haiku sources and in this cases (maybe you read form console
or serial but it's the same) and you DO create a thread wrapped it in a
class and you, really, re-implement your messaging system... a copy of
BMessage in the end... all the times!

So my question:

   1. It's possible to have BMessage w/o BApllication? It's possible to
   separate this 2 things? For my point of view they are NOT the same! If not
   a BSimpleMessage totally compatible with BMessage in Support Kit?
   2. More useful, maybe, a wrapper class for a thread with a sort of
   (B)message loop? A BWorker let me say?

What do you think?

Thanks for your prompt response and...

Good Sunday,

fano

Other related posts: