2 #include <Application.h>
5 class MyLooper
: public BLooper
8 MyLooper(BLooper
*looper
) : BLooper("test") {
9 printf("Looper created\n");
13 virtual void MessageReceived(BMessage
*msg
) {
14 printf("MessageReceived : %.4s\n", (char*)&msg
->what
);
18 BMessenger(fLooper
).SendMessage(msg
);
21 msg
->SendReply('couc');
24 BLooper::MessageReceived(msg
);
31 class App
: public BApplication
34 App() : BApplication("application/test") {
37 virtual void ReadyToRun() {
38 MyLooper
looper2(NULL
);
40 MyLooper
looper1(&looper2
);
42 printf("loopers run\n");
44 BMessenger(&looper1
).SendMessage('toto', &reply
);
45 printf("message sent and replied\ncheck there is only a 'couc' what in the reply\n");
46 reply
.PrintToStream();