regarding popup window










hi list !

            i'am a newbie to gtk and im using gtk-1.2
. i have developed a voice chat application on linux
and i want a window popped up when there is a incoming
call i tried a pop up window  - which i call from a
callback function of the stack which i use for the
voice chat application - its something like this :

on_incoming_call ()

 {

    popup_window( );

     some code goes here .... - this is related to the
appl 

}

now inside pop up window the code looks something like
this :



void Popup()
 {
 
  GtkWidget *dialog_vbox1;
  GtkWidget *inner_box;
  GtkWidget *message;
  GtkWidget *dialog_action_area1;
  GtkWidget *fixed2;
  GtkWidget *yes;
  GtkWidget *no;

  popup = gtk_dialog_new ();
  gtk_object_set_data (GTK_OBJECT (popup), "popup",
popup);
  GTK_WIDGET_SET_FLAGS (popup, GTK_CAN_FOCUS);
  GTK_WIDGET_SET_FLAGS (popup, GTK_CAN_DEFAULT);
  gtk_widget_set_extension_events (popup,
GDK_EXTENSION_EVENTS_ALL);
  gtk_window_set_title (GTK_WINDOW (popup), "Alert
user");
  gtk_window_set_position (GTK_WINDOW (popup),
GTK_WIN_POS_CENTER);
  gtk_window_set_modal (GTK_WINDOW (popup), TRUE);
  gtk_window_set_policy (GTK_WINDOW (popup), FALSE,
FALSE, FALSE);

  dialog_vbox1 = GTK_DIALOG (popup)->vbox;
  gtk_object_set_data (GTK_OBJECT (popup),
"dialog_vbox1", dialog_vbox1);
  gtk_widget_show (dialog_vbox1);

  inner_box = gtk_fixed_new ();
  gtk_widget_ref (inner_box);
  gtk_object_set_data_full (GTK_OBJECT (popup),
"inner_box", inner_box,
                            (GtkDestroyNotify)
gtk_widget_unref);
  gtk_widget_show (inner_box);
  gtk_box_pack_start (GTK_BOX (dialog_vbox1),
inner_box, TRUE, TRUE, 0);

  message = gtk_label_new ("Call from Amtihmit Accept
?");
  gtk_widget_ref (message);
  gtk_object_set_data_full (GTK_OBJECT (popup),
"message", message,
                            (GtkDestroyNotify)
gtk_widget_unref);
  gtk_widget_show (message);
  gtk_fixed_put (GTK_FIXED (inner_box), message, 0,
8);
  gtk_widget_set_uposition (message, 0, 8);
  gtk_widget_set_usize (message, 276, 59);
  GTK_WIDGET_SET_FLAGS (message, GTK_CAN_FOCUS);
  GTK_WIDGET_SET_FLAGS (message, GTK_CAN_DEFAULT);
  gtk_misc_set_alignment (GTK_MISC (message), 0.53,
0.5);
  gtk_misc_set_padding (GTK_MISC (message), 71, 0);

  dialog_action_area1 = GTK_DIALOG
(popup)->action_area;
  gtk_object_set_data (GTK_OBJECT (popup),
"dialog_action_area1", dialog_action_area1);
  gtk_widget_show (dialog_action_area1);
  gtk_container_set_border_width (GTK_CONTAINER
(dialog_action_area1), 10);

  fixed2 = gtk_fixed_new ();
  gtk_widget_ref (fixed2);
  gtk_object_set_data_full (GTK_OBJECT (popup),
"fixed2", fixed2,
                            (GtkDestroyNotify)
gtk_widget_unref);
  gtk_widget_show (fixed2);
  gtk_box_pack_start (GTK_BOX (dialog_action_area1),
fixed2, TRUE, TRUE, 0);

  yes = gtk_button_new_with_label ("yes");
  gtk_widget_ref (yes);
  gtk_object_set_data_full (GTK_OBJECT (popup), "yes",
yes,
                            (GtkDestroyNotify)
gtk_widget_unref);
  gtk_widget_show (yes);
  gtk_fixed_put (GTK_FIXED (fixed2), yes, 56, 3);
  gtk_widget_set_uposition (yes, 56, 3);
  gtk_widget_set_usize (yes, 63, 21);
  GTK_WIDGET_UNSET_FLAGS (yes, GTK_CAN_FOCUS);

  no = gtk_button_new_with_label ("no");
  gtk_widget_ref (no);
  gtk_object_set_data_full (GTK_OBJECT (popup), "no",
no,
                            (GtkDestroyNotify)
gtk_widget_unref);
  gtk_widget_show (no);
  gtk_fixed_put (GTK_FIXED (fixed2), no, 152, 4);
  gtk_widget_set_uposition (no, 152, 4);
  gtk_widget_set_usize (no, 63, 21);

  gtk_signal_connect (GTK_OBJECT (yes), "clicked",
                      GTK_SIGNAL_FUNC
(on_yes_clicked),
                      NULL);
  gtk_signal_connect (GTK_OBJECT (no), "clicked",
                      GTK_SIGNAL_FUNC (on_no_clicked),
                      NULL);

  gtk_widget_grab_focus (popup);
  gtk_widget_grab_default (popup);
  
  gtk_widget_show(popup);

 }
 

Now what happens with this code is that the window
(popup) pops up but to see it the mouse has to be
moved - in otherwords without any movement of the
mouse on the screen the window (popup) isnt visible.

ive generated this code using Glade .

could anyone help me out with what has to be changed
:-).

thanks in advance .

best regards,

simith N

 

=====
"BIG JOHN NEVER PAYS!":check out Wanda the Fish on RH Linux
Simith Nambiar,
Student 
MIT,Manipal
www.nambiars.8k.com
www.simzone.8k.com

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com



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