problem with closing dialogs



Dear all,
I have used glade to develop an application - which initially asks for a password(a login/password dialog)
I have another dialog box created(again using glade) which shows an error message(with a OK button). 

I have a function called "ShowErr(char *str)" in chich i have called the create_errmsg() function.
Now the problem is that in case a user does not enter a password or enters a wrong password i call the 
ShowErr() function. The Error Dialog is shown but when i click OK it does not close(although i have a 
callback for the OK button) its only when i enter right password(after which another window) appears, that am 
able to close the error dialog.

The ShowErr() function is a generic function which i use to show any kind of errors. I dont face this problem 
when am calling the function elsewhere from other dialogs its only the first Logi Dialog in which am facing 
the problem. 
Can anyone suggest what i can do about this. Thanx in advance

heres the code snippet :

/*This is when i call the ShowErr function*/
if( memcmp( sTemp, sEncPass, strlen( sEncPass)) != 0)
{
                LOGERR( " Invalid password!\n");
                ShowErr( " Invalid Password!");
                FREE( sEncPass);
                return;
}       


/*This is the ShowErr() function*/
void ShowErr( char *str,... )
{
        GtkWidget *errormsg;
        char sErrorString[_STRING_MAX_CHARS_*4];
        va_list vl;
        
        memset( sErrorString, 0x00, _STRING_MAX_CHARS_*4);
        if (str != NULL)
        {
                va_start( vl, str);
                vsprintf( sErrorString, str, vl);
        }
        else
                strcpy( sErrorString, "Internal Error. Try Again!");
   
        errormsg = create_errmsg( sErrorString);
        gtk_widget_show( errormsg);

}

-partha
_____________
parthasarathi s a
Odyssey Technologies
e-mail: parthasarathi at odysseytec dot com
___________________ 
Be more concerned with your character than your reputation, 
because your character is what you really are, 
while your reputation is merely what others think you are.              
                                --John Wooden 
___________________



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