MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_widths

Function get_widths

win/X11/winstat.c:2247–2268  ·  view source on GitHub ↗

* Get current width of value. width2p is only valid for SV_VALUE types. */

Source from the content-addressed store, hash-verified

2245 * Get current width of value. width2p is only valid for SV_VALUE types.
2246 */
2247static void
2248get_widths(struct X_status_value *sv, int *width1p, int *width2p)
2249{
2250 Arg args[1];
2251 Dimension width;
2252
2253 switch (sv->type) {
2254 case SV_VALUE:
2255 *width1p = get_name_width(sv->w);
2256 *width2p = get_value_width(sv->w);
2257 break;
2258 case SV_LABEL:
2259 case SV_NAME:
2260 XtSetArg(args[0], XtNwidth, &width);
2261 XtGetValues(sv->w, args, ONE);
2262 *width1p = width;
2263 *width2p = 0;
2264 break;
2265 default:
2266 panic("get_widths: unknown type %d", sv->type);
2267 }
2268}
2269
2270static void
2271set_widths(struct X_status_value *sv, int width1, int width2)

Callers 1

init_columnFunction · 0.85

Calls 3

get_name_widthFunction · 0.85
get_value_widthFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected