MCPcopy Create free account
hub / github.com/SimHacker/micropolis / CanvasSelectTo

Function CanvasSelectTo

micropolis-activity/src/tk/tkcanvas.c:3166–3212  ·  view source on GitHub ↗
(canvasPtr, itemPtr, index)

Source from the content-addressed store, hash-verified

3164 EventuallyRedrawArea(canvasPtr, canvasPtr->focusItemPtr->x1,
3165 canvasPtr->focusItemPtr->y1, canvasPtr->focusItemPtr->x2,
3166 canvasPtr->focusItemPtr->y2);
3167 }
3168}
3169
3170
3171/*
3172 *----------------------------------------------------------------------
3173 *
3174 * CanvasSelectTo --
3175 *
3176 * Modify the selection by moving its un-anchored end. This could
3177 * make the selection either larger or smaller.
3178 *
3179 * Results:
3180 * None.
3181 *
3182 * Side effects:
3183 * The selection changes.
3184 *
3185 *----------------------------------------------------------------------
3186 */
3187
3188static void
3189CanvasSelectTo(canvasPtr, itemPtr, index)
3190 register Tk_Canvas *canvasPtr; /* Information about widget. */
3191 register Tk_Item *itemPtr; /* Item that is to hold selection. */
3192 int index; /* Index of element that is to
3193 * become the "other" end of the
3194 * selection. */
3195{
3196 int oldFirst, oldLast;
3197 Tk_Item *oldSelPtr;
3198
3199 oldFirst = canvasPtr->selectFirst;
3200 oldLast = canvasPtr->selectLast;
3201 oldSelPtr = canvasPtr->selItemPtr;
3202
3203 /*
3204 * Grab the selection if we don't own it already.
3205 */
3206
3207 if (canvasPtr->selItemPtr == NULL) {
3208 Tk_OwnSelection(canvasPtr->tkwin, CanvasLostSelection,
3209 (ClientData) canvasPtr);
3210 } else if (canvasPtr->selItemPtr != itemPtr) {
3211 EventuallyRedrawArea(canvasPtr, canvasPtr->selItemPtr->x1,
3212 canvasPtr->selItemPtr->y1, canvasPtr->selItemPtr->x2,
3213 canvasPtr->selItemPtr->y2);
3214 }
3215 canvasPtr->selItemPtr = itemPtr;

Callers 1

CanvasWidgetCmdFunction · 0.85

Calls 2

Tk_OwnSelectionFunction · 0.85
EventuallyRedrawAreaFunction · 0.85

Tested by

no test coverage detected