How to open a dialog box on button click event

Nainesh Parekh <[email protected]>
Newsgroups gmane.comp.gnome.glade.devel
Message-ID <[email protected]>
Hello friends,
I m a newbie to this mailing list and to glade development.
For my project , i m using glade-3 and designed a basic window with a button
and a dialog box.
I don't know how to connect to dialog box on button click from my basic
window.
I m attaching .glade and .c file , plz help me out.

Also, if you know any good tutorial for glade , for beginners like me , then
plz send me link.

Plz forgive me if i composed my mail or attachment in a wrong way.

thanks in advance.

_______________________________________________
Glade-devel maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/glade-devel
signal.c (text/x-csrc, 1.2 KB)
#include <gtk/gtk.h>
#include <glade/glade.h>

void gtk_widget_show1(GtkWidget *widget, gpointer user_data)
{
	//  GladeXML *window;
	//  GTKWidget *widget;
	//  window=glade_xml_new ("signalevent.glade",NULL,NULL);
	//  widget = glade_xml_get_widget (main_window, "mudialog");

	  printf ("Thanks for trying out my program.\n");
	 // gtk_window_set_default_size (GTK_WINDOW (dialog), 10, 20);
	  gtk_widget_show(user_data);
	    gtk_main_quit ();
}

int main (int argc, char *argv[])
{
	  GladeXML  *main_window;
	  GtkWidget *widget;

	  gtk_init (&argc, &argv);

	  /* load the interface */
	  main_window = glade_xml_new ("signalevent.glade", NULL, NULL);

	  /* connect the signals in the interface */
	  /* Have the ok button call the ok_button_clicked callback */
	  widget = glade_xml_get_widget (main_window, "button1");
          g_signal_connect (G_OBJECT (widget), "clicked",G_CALLBACK (gtk_widget_show1),"mydialog");

          /* Have the delete event (window close) end the program */
          widget = glade_xml_get_widget (main_window, "window1");
          g_signal_connect (G_OBJECT (widget), "delete_event",G_CALLBACK (gtk_main_quit), NULL);

	  /* start the event loop */
	  gtk_main ();

			    return 0;
}
signalevent.glade (application/x-glade, 3.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.