void gdbOpenProcessCB(Widget w, XtPointer, XtPointer)
{
    static Widget dialog = 0;
    static Widget processes = 0;

    if (dialog == 0)
    {
	Arg args[10];
	int arg = 0;
    
	XtSetArg(args[arg], XmNautoUnmanage, False); arg++;
	dialog = verify(XmCreateSelectionDialog(find_shell(w), 
						XMST("processes"), 
						args, arg));

	Delay::register_shell(dialog);

	XtUnmanageChild(XmSelectionBoxGetChild(dialog, 
					       XmDIALOG_SELECTION_LABEL));
	XtUnmanageChild(XmSelectionBoxGetChild(dialog, 
					       XmDIALOG_TEXT));

	processes = XmSelectionBoxGetChild(dialog, XmDIALOG_LIST);

	XtAddCallback(processes, XmNsingleSelectionCallback,
		      SelectProcessCB, XtPointer(processes));
	XtAddCallback(processes, XmNmultipleSelectionCallback,
		      SelectProcessCB, XtPointer(processes));
	XtAddCallback(processes, XmNextendedSelectionCallback,
		      SelectProcessCB, XtPointer(processes));
	XtAddCallback(processes, XmNbrowseSelectionCallback,
		      SelectProcessCB, XtPointer(processes));

	XtAddCallback(dialog, XmNokCallback, 
		      openProcessDone, XtPointer(processes));
	XtAddCallback(dialog, XmNapplyCallback, 
		      gdbUpdateProcessesCB, XtPointer(processes));
	XtAddCallback(dialog, XmNcancelCallback, 
		      UnmanageThisCB, XtPointer(dialog));
	XtAddCallback(dialog, XmNhelpCallback, ImmediateHelpCB, 0);
    }

    update_processes(processes, false);
    manage_and_raise(dialog);
    warn_if_no_program(dialog);
}
bool top_globalstats_update(void *ptr, const void *sample) {
    const libtop_tsamp_t *tsamp = sample;
    struct globalstat_controller *c = ptr;
    int i;

	if (!top_prefs_get_logging_mode()) {
		for(i = 0; i < GLOBALSTAT_TOTAL; ++i) {
			// MWW: If we've disabled framework logging one of these windows isn't valid and needs skipping
			if (!top_prefs_get_frameworks() && (i == GLOBALSTAT_SHAREDLIBS)) continue;
			werase(c->stats[i].window);
		}
	}

    update_processes(c->stats + GLOBALSTAT_PROCESSES, tsamp);
    update_load(c->stats + GLOBALSTAT_LOAD, tsamp);
    update_cpu(c->stats + GLOBALSTAT_CPU, tsamp);

    if(top_prefs_get_frameworks())
	update_sharedlibs(c->stats + GLOBALSTAT_SHAREDLIBS, tsamp);

    update_memregions(c->stats + GLOBALSTAT_MEMREGIONS, tsamp);
    update_physmem(c->stats + GLOBALSTAT_PHYSMEM, tsamp);
    update_vm(c->stats + GLOBALSTAT_VM, tsamp);
    update_time(c->stats + GLOBALSTAT_TIME, tsamp);

    if(top_prefs_get_swap()) {
	update_swap(c->stats + GLOBALSTAT_SWAP, tsamp);
	update_purgeable(c->stats + GLOBALSTAT_PURGEABLE, tsamp);
    }

    if(update_networks(c->stats + GLOBALSTAT_NETWORKS, tsamp))
	top_log("An error occurred while updating the network global stats.\n");

    if(update_disks(c->stats + GLOBALSTAT_DISKS, tsamp))
	top_log("An erorr occurred while updating the disk global stats.\n");

    return false;
}
static void gdbUpdateProcessesCB(Widget, XtPointer client_data, XtPointer)
{
    Widget processes = Widget(client_data);
    update_processes(processes, true);
}