Re: problem with closing dialogs



 Post the code where you create the error message dialog. Make sure that the OK
button on it is connected.

 The example on GTKDialog (see docs) shows a way to close the dialog by
clokcing the OK button without having to create your own call back.
(g_signal_connect_swapped(ok_button, dialog).. See the docs.


Harring.
--- parthasarathi s a <parthasarathi mail cyberneme com> wrote:
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 
___________________
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


=====
"We should do smart things with stupid technology before we do stupid 
things with smart technology."
                              --Bill Buxton, Alias Research


Harring Figueiredo

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



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