~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gtk/gtkstatusbar.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-06-11 12:19:30 UTC
  • mfrom: (1.11.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 175.
  • Revision ID: james.westby@ubuntu.com-20100611121930-n4pklvkoqdsg12vm
Tags: 2.21.2-1
* New upstream development release:
  + debian/rules,
    debian/libgtk2.0-0.symbols:
    - Update for new API symbols.
  + debian/patches/070_mandatory-relibtoolize.patch:
    - Regenerated for the new version.
  + debian/control.in:
    - Update GLib (build-) dependency to >= 2.25.8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
}
464
464
 
465
465
/**
 
466
 * gtk_statusbar_remove_all:
 
467
 * @statusbar: a #GtkStatusBar
 
468
 * @context_id: a context identifier
 
469
 *
 
470
 * Forces the removal of all messages from a statusbar's
 
471
 * stack with the exact @context_id.
 
472
 *
 
473
 * Since: 2.22
 
474
 */
 
475
void
 
476
gtk_statusbar_remove_all (GtkStatusbar *statusbar,
 
477
                          guint         context_id)
 
478
{
 
479
  GtkStatusbarMsg *msg;
 
480
  GSList *prev, *list;
 
481
 
 
482
  g_return_if_fail (GTK_IS_STATUSBAR (statusbar));
 
483
 
 
484
  if (statusbar->messages == NULL)
 
485
    return;
 
486
 
 
487
  msg = statusbar->messages->data;
 
488
 
 
489
  /* care about signal emission if the topmost item is removed */
 
490
  if (msg->context_id == context_id)
 
491
    {
 
492
      gtk_statusbar_pop (statusbar, context_id);
 
493
 
 
494
      prev = NULL;
 
495
      list = statusbar->messages;
 
496
    }
 
497
  else
 
498
    {
 
499
      prev = statusbar->messages;
 
500
      list = prev->next;
 
501
    }
 
502
 
 
503
  while (list != NULL)
 
504
    {
 
505
      msg = list->data;
 
506
 
 
507
      if (msg->context_id == context_id)
 
508
        {
 
509
          if (prev == NULL)
 
510
            statusbar->messages = list->next;
 
511
          else
 
512
            prev->next = list->next;
 
513
 
 
514
          g_free (msg->text);
 
515
          g_slice_free (GtkStatusbarMsg, msg);
 
516
          g_slist_free_1 (list);
 
517
 
 
518
          if (prev == NULL)
 
519
            prev = statusbar->messages;
 
520
 
 
521
          list = prev->next;
 
522
        }
 
523
      else
 
524
        {
 
525
          prev = list;
 
526
          list = prev->next;
 
527
        }
 
528
    }
 
529
}
 
530
 
 
531
/**
466
532
 * gtk_statusbar_set_has_resize_grip:
467
533
 * @statusbar: a #GtkStatusBar
468
534
 * @setting: %TRUE to have a resize grip