-/* $Id: macctrls.c,v 1.20 2003/03/29 22:04:21 ben Exp $ */
+/* $Id: macctrls.c,v 1.21 2003/03/29 23:07:55 ben Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
for (i = 1; i < cb->nctrlsets; i++)
if (strcmp(cb->ctrlsets[i]->pathname, cb->ctrlsets[i-1]->pathname))
mcs->npanels++;
- mcs->panels = smalloc(sizeof(*mcs->panels) * mcs->npanels);
+ mcs->panels = snewn(mcs->npanels, union macctrl *);
memset(mcs->panels, 0, sizeof(*mcs->panels) * mcs->npanels);
curstate.panelnum = 0;
for (i = 0; i < cb->nctrlsets; i++) {
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect bounds;
SInt16 height;
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect lbounds, bounds;
fprintf(stderr, " label = %s\n", ctrl->editbox.label);
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect bounds;
Str255 title;
unsigned int i, colwidth;
mc->generic.type = MACCTRL_RADIO;
mc->generic.ctrl = ctrl;
mc->generic.privdata = NULL;
- mc->radio.tbctrls =
- smalloc(sizeof(*mc->radio.tbctrls) * ctrl->radio.nbuttons);
+ mc->radio.tbctrls = snewn(ctrl->radio.nbuttons, ControlRef);
colwidth = (curstate->width + 13) / ctrl->radio.ncolumns;
bounds.top = curstate->pos.v;
bounds.bottom = bounds.top + 16;
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect bounds;
Str255 title;
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect bounds;
Str255 title;
struct mac_layoutstate *curstate,
union control *ctrl)
{
- union macctrl *mc = smalloc(sizeof *mc);
+ union macctrl *mc = snew(union macctrl);
Rect bounds;
Str255 title;
unsigned int labelwidth;
index = CountMenuItems(menu) - 1;
if (mc->popup.nids <= index) {
mc->popup.nids = index + 1;
- mc->popup.ids = srealloc(mc->popup.ids,
- mc->popup.nids * sizeof(*mc->popup.ids));
+ mc->popup.ids = sresize(mc->popup.ids, mc->popup.nids, int);
}
mc->popup.ids[index] = id;
}