本文整理汇总了C++中gtk::MessageDialog::show方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageDialog::show方法的具体用法?C++ MessageDialog::show怎么用?C++ MessageDialog::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk::MessageDialog
的用法示例。
在下文中一共展示了MessageDialog::show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show_dialog
void show_dialog() const
{
Gtk::MessageDialog* dialog = new Gtk::MessageDialog(
m_simple_desc,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_NONE,
false);
Gtk::Window* parent = NULL;
Gtk::Widget* toplevel_widget = m_widget->get_toplevel();
if(gtk_widget_is_toplevel(toplevel_widget->gobj()))
parent = dynamic_cast<Gtk::Window*>(toplevel_widget);
g_assert(parent != NULL);
dialog->set_transient_for(*parent);
dialog->add_button(_("_Close"), Gtk::RESPONSE_CLOSE);
dialog->set_secondary_text(m_detail_desc, true);
dialog->signal_response().connect(
sigc::hide(
sigc::bind(
sigc::ptr_fun(dispose_dialog),
dialog)));
dialog->show();
}
示例2: show_dialog
void show_dialog() const
{
Gtk::MessageDialog* dialog = new Gtk::MessageDialog(
m_simple_desc,
false,
Gtk::MESSAGE_ERROR,
Gtk::BUTTONS_NONE,
false);
dialog->add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
dialog->set_secondary_text(m_detail_desc, true);
dialog->signal_response().connect(
sigc::hide(
sigc::bind(
sigc::ptr_fun(dispose_dialog),
dialog)));
dialog->show();
}
示例3: show_msg
void ErrorPopup::show_msg() {
dialog = new Gtk::MessageDialog(msg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
dialog->set_keep_above(true);
//Gtk::VBox *ma = dialog->get_message_area(); // not in Gtkmm 0.20
//FIXME: no comment :-)
Gtk::VBox *ma = dynamic_cast<Gtk::VBox*>(
*(++dynamic_cast<Gtk::HBox*>(
*dialog->get_vbox()->get_children().begin())->get_children().begin()));
// add an alignment parent to the label widget inside the message area
// should better define our own dialog instead of hacking MessageDialog...
Gtk::Alignment *align = new Gtk::Alignment();
align->show();
dynamic_cast<Gtk::Label*>(*ma->get_children().begin())->reparent(*align);
ma->pack_start(*manage(align));
align->set_padding(50,20,0,10);
Gtk::VBox *vbox = dynamic_cast<Gtk::VBox *>(dialog->get_child());
vbox->set_redraw_on_allocate(true);
vbox->signal_expose_event().connect(
sigc::group(&gx_cairo::error_box_expose,GTK_WIDGET(vbox->gobj()),sigc::_1,(void*)0),false);
dialog->set_title(_("GUITARIX ERROR"));
dialog->signal_response().connect(
sigc::mem_fun(*this, &ErrorPopup::on_response));
dialog->show();
}
示例4: show
void show()
{
onRefresh();
mp_Dialog->show();
}