let update w =
  main_bbar := Some w;
  (match w#children with
    c :: _ -> w#remove c
  | _ -> ());
  let toolbar = GButton.toolbar
      ~border_width: 2
      ~orientation: `HORIZONTAL
      ~style: `ICONS
      ~packing: w#add ()
  in
  List.iter
    (fun b ->
      try
        let gdk_pix = GDraw.pixmap_from_xpm
            ~file: b.but_pixmap
            ~colormap: (Gdk.Color.get_system_colormap ())
            ()
        in
        let pix = GMisc.pixmap gdk_pix () in
        let wb = toolbar#insert_button
            ~text: b.but_label
            ~tooltip: b.but_label
            ~icon: pix#coerce
            ()
        in
        ignore (wb#connect#clicked (fun () -> Cam_commands.eval_command b.but_command))
      with
        _ -> ()
    )
    buttons#get