Window as Popup
- From: benya <saviodomnic yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: Window as Popup
- Date: Wed, 13 Oct 2010 06:57:37 -0700 (PDT)
Hello there,
I am trying to create a calculator window that has to popup on a button
press.
The window pops up with the buttons on it, but when I press a button, the
event is not propagated or generated or the event handler is not called.
void on_recall_clicked (GtkWidget *widget, gpointer user_data){
recall_dialog(GTK_WINDOW(user_data));
}
void recall_dialog (GtkWindow *parent) {
GtkWidget *calci, *content_area, *numTable;
GtkWidget *oneBut, *twoBut, *threeBut, *fourBut, *fiveBut, *sixBut,
*sevenBut,*eightBut,
*nineBut, *zeroBut, *enterBut, *clearBut;
/* Create the widgets */
calci = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_default_size(GTK_WINDOW(calci), 300, 300);
gtk_window_set_position(GTK_WINDOW(calci), GTK_WIN_POS_CENTER);
gtk_container_set_border_width(GTK_CONTAINER(calci), 10);
gtk_window_set_title(GTK_WINDOW(calci), "Calculate a Receipt");
...
adding the buttons and their event handler....
...
g_signal_connect (G_OBJECT (calci), "delete_event",
G_CALLBACK (gtk_widget_destroy), NULL);
g_signal_connect (G_OBJECT (enterBut), "destroy",
G_CALLBACK (gtk_main_quit), NULL);
gtk_window_set_transient_for(GTK_WINDOW(calci),GTK_WINDOW(window));
gtk_widget_show_all (calci);
I am not sure what is wrong in my code. I am new to Gtk and I would
appreciate any help on this.
Thank you
Denny
--
View this message in context: http://old.nabble.com/Window-as-Popup-tp29953023p29953023.html
Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]