本文整理汇总了C++中BLooper::PostMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ BLooper::PostMessage方法的具体用法?C++ BLooper::PostMessage怎么用?C++ BLooper::PostMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLooper
的用法示例。
在下文中一共展示了BLooper::PostMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg
void
ColorPickerPanel::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_CANCEL:
case MSG_DONE:
{
BMessage msg('PSTE');
BLooper* looper = fTarget ? fTarget->Looper() : be_app;
if (fMessage)
msg = *fMessage;
if (message->what == MSG_DONE)
store_color_in_message(&msg, fColorPickerView->Color());
msg.AddRect("panel frame", Frame());
msg.AddInt32("panel mode", fColorPickerView->Mode());
msg.AddBool("begin", true);
looper->PostMessage(&msg, fTarget);
PostMessage(B_QUIT_REQUESTED);
break;
}
default:
Panel::MessageReceived(message);
break;
}
}
示例2: message
// SelectionChanged
void
SimpleListView::SelectionChanged()
{
BLooper* looper = Looper();
if (fSelectionChangeMessage && looper) {
BMessage message(*fSelectionChangeMessage);
looper->PostMessage(&message);
}
}
示例3: ticker
int32 ticker(void *data) {
BMessage *msg = (BMessage *)data;
int64 snooze_time = 0;
msg->FindInt64("snooze", &snooze_time);
BLooper *looper = 0;
msg->FindPointer("looper", (void **)&looper);
delete msg;
if (looper==0 || snooze_time==0) return 10;
long long nexttick = system_time();
for (;;) {
nexttick += snooze_time;
snooze_until(nexttick, B_SYSTEM_TIMEBASE);
looper->PostMessage('tick');
}
return 0;
}
示例4: MessageReceived
void NamePanel::MessageReceived(BMessage* message)
{
switch (message->what) {
case MSG_PANEL_CANCEL:
Quit();
break;
case MSG_PANEL_OK: {
if (!fTarget)
fTarget = fWindow;
BLooper* looper = fTarget ? fTarget->Looper() : NULL;
if (fMessage && looper) {
BMessage cloneMessage(*fMessage);
cloneMessage.AddString("name", fNameTC->Text());
cloneMessage.AddRect("frame", Frame());
looper->PostMessage(&cloneMessage, fTarget);
}
Quit();
break;
}
default:
Panel::MessageReceived(message);
}
}