Re: [gtk-list] Segvs and other madness



On Wed, 25 Feb 1998, Gregory A. McLean wrote:

> This was done in this fashion to segment the snmp stuff out so that it
> can use multiple snmp libraries without lots of ifdefs peppered throughout
> the program.
> 
> Here is the function in question:
> void
> update_app_stat (gchar *stat)
> {
>   gtk_statusbar_pop (GTK_STATUSBAR (app_info->app_stat_id));
>   app_info->app_stat_id = gtk_statusbar_push (GTK_STATUSBAR
>                                               (app_info->app_stat), stat);
> }
> 
> Smells like gtk_statusbar_pop isn't liking a pop operation on an empty 
> statusbar, or if the argument contains unknown un validated values?

gtk_statusbar_pop() can handle an empty stack, but you are passing
the status id and not the statusbar widget itself to the function.
if you want to get an id removed that has been returned from gtk_statusbar_push
you need to gtk_statusbar_steal (GTK_STATUSBAR (app_info->app_stat),
                                 app_info->app_stat_id);
other than that you need to invoke gtk_statusbar_pop in the following manner:
gtk_statusbar_pop (GTK_STATUSBAR (app_info->app_stat));

                                 
> 
> Off to cvs -z9 update gtk+ and see if that clears it up.
> 

---
ciaoTJ



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