Re: messagedialog



On Fri, 2007-10-19 at 07:43 -0400, Tralfas D wrote:
> how would you make a messagedialog without making a window. for
> instance instead of making a button and then having the message dialog
> appear when the button was clicked just have the message dialog box
> show up. and if thats even possible what would the parent be?
>  

Just a dialog?

#include <gtkmm.h>

static void quit(int res)
{
    gtk_main_quit();
}

int main(int argc, char** argv)
{
    Gtk::Main kit(argc, argv);

    Gtk::MessageDialog dialog("foo", false,
                              Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, true);
  
    dialog.set_secondary_text("bar");
    dialog.signal_response().connect(sigc::ptr_fun(&quit));

    Gtk::Main::run(dialog);
}

s.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]