spinbutton's problem



Title: Message
 

Hi All,

I'm developing an application which has  2 spinbutton in a window(screen). The two spinbuttons has range 1-900. If user typed any number more than 900 in any spinbutton(say first) , and clicked outside (in any other widget of the window) ,one dialog box is coming , informing users that 900 is max limit. And spinbutton's(first) content is automatically changes to 900. But if user is clicked on other spinbutton's arrow(after entring any number >900 in first button), the dialog box is coming , the content of the first spinbutton is set to 900 and  when user press "OK" button on the dialog box, the other spinbutton's(2nd spinbutton) content is automatically changing and stop at extreme limit. I am not able to stop it because i am not able to stop the signal which the spinbutton is emiting internally  while clicking on its arrow.

We r using "focus-out-event" to show the dialog box.

I am giving some part of the code :

 

 

gchar *Sizelimit;

gint size;

Sizelimit = g_strdup (gtk_entry_get_text ((GtkEntry *) spinbutton1));
size = atoi (Sizelimit);

if (size > 900)
        {
          gtk_spin_button_set_value ((GtkSpinButton *) spinbutton1,
                                     (gdouble) 900);
          dialog =
            gtk_message_dialog_new ((GtkWindow *) window1,
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
                                    " Max value is 1000.\n");
          gtk_dialog_run (GTK_DIALOG (dialog));
          gtk_widget_destroy (dialog);
        }

 

 

I need to stop the continuous moving of other spinbutton's content while clicking on it if i enter any number more than 900 in the first spinbutton and dialog box is coming.

 

thanks and regards

 

Abhijit Nath

Wipro Technology.

India

 

 
 


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