本文整理汇总了C++中gtk::MessageDialog::set_message方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageDialog::set_message方法的具体用法?C++ MessageDialog::set_message怎么用?C++ MessageDialog::set_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::MessageDialog
的用法示例。
在下文中一共展示了MessageDialog::set_message方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void show()
{
openfluid::core::UnitsCollection* TestUnitsColl = 0;
if (!mp_SimulationBlob)
{
mp_Dialog->set_message("I am DummyModalWindow\n"
"Nb of units in TestUnits class: no CoreRepository\n"
"Nothing to do");
}
else
{
unsigned int Size = 0;
TestUnitsColl = mp_SimulationBlob->getCoreRepository().getUnits(
"TestUnits");
if (TestUnitsColl)
Size = TestUnitsColl->getList()->size();
mp_Dialog->set_message(Glib::ustring::compose("I am DummyModalWindow\n"
"Nb of units in TestUnits class: %1\n"
"Clicking ok will add a Unit of class \"TestUnits\"", Size));
}
if (mp_Dialog->run() == Gtk::RESPONSE_OK && mp_SimulationBlob)
{
unsigned int NextId = 1;
if (TestUnitsColl)
{
openfluid::core::UnitsList_t* TestUnits = TestUnitsColl->getList();
if (!TestUnits->empty())
{
NextId = TestUnits->end().operator --()->getID() + 1;
while (TestUnitsColl->getUnit(NextId))
NextId++;
}
}
openfluid::core::Unit U("TestUnits", NextId, 1,
openfluid::core::InstantiationInfo::DESCRIPTOR);
mp_SimulationBlob->getCoreRepository().addUnit(U);
signal_ChangedOccurs().emit();
}
mp_Dialog->hide();
}
示例2: onRefresh
void onRefresh()
{
unsigned int Size = 0;
if (!mp_SimulationBlob)
mp_Dialog->set_message("I am DummyModelessWindow\n"
"Nb of units in TestUnits class: no CoreRepository\n"
"Nothing to do");
else
{
mp_TestUnitsColl = mp_SimulationBlob->getCoreRepository().getUnits(
"TestUnits");
if (mp_TestUnitsColl)
Size = mp_TestUnitsColl->getList()->size();
mp_Dialog->set_message(Glib::ustring::compose(
"I am DummyModelessWindow\n"
"Nb of units in TestUnits class: %1\n"
"Clicking ok will add a Unit of class \"TestUnits\"", Size));
}
}
示例3: on_message
void ErrorPopup::on_message(const Glib::ustring& msg_, GxLogger::MsgType tp, bool plugged) {
if (plugged) {
return;
}
if (tp == GxLogger::kError) {
if (active) {
msg += "\n" + msg_;
if (msg.size() > 1000) {
msg.substr(msg.size()-1000);
}
if (dialog) {
dialog->set_message(msg);
}
} else {
msg = msg_;
active = true;
show_msg();
}
}
}