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

Function Tk_OwnSelection

micropolis-activity/src/tk/tkselect.c:305–337  ·  view source on GitHub ↗
(tkwin, proc, clientData)

Source from the content-addressed store, hash-verified

303 *
304 *--------------------------------------------------------------
305 */
306
307void
308Tk_OwnSelection(tkwin, proc, clientData)
309 Tk_Window tkwin; /* Window to become new selection
310 * owner. */
311 Tk_LostSelProc *proc; /* Procedure to call when selection
312 * is taken away from tkwin. */
313 ClientData clientData; /* Arbitrary one-word argument to
314 * pass to proc. */
315{
316 register TkWindow *winPtr = (TkWindow *) tkwin;
317 TkDisplay *dispPtr = winPtr->dispPtr;
318
319 if (dispPtr->multipleAtom == None) {
320 SelInit(tkwin);
321 }
322
323 winPtr->selClearProc = proc;
324 winPtr->selClearData = clientData;
325 if (dispPtr->selectionOwner != tkwin) {
326 TkWindow *ownerPtr = (TkWindow *) dispPtr->selectionOwner;
327
328 if ((ownerPtr != NULL)
329 && (ownerPtr->selClearProc != NULL)) {
330 (*ownerPtr->selClearProc)(ownerPtr->selClearData);
331 ownerPtr->selClearProc = NULL;
332 }
333 }
334 dispPtr->selectionOwner = tkwin;
335 dispPtr->selectionSerial = NextRequest(winPtr->display);
336 dispPtr->selectionTime = TkCurrentTime(dispPtr);
337 XSetSelectionOwner(winPtr->display, XA_PRIMARY, winPtr->window,
338 dispPtr->selectionTime);
339}
340

Callers 7

ConfigureListboxFunction · 0.85
ListboxSelectFromFunction · 0.85
TkTextTagCmdFunction · 0.85
ConfigureEntryFunction · 0.85
EntrySelectToFunction · 0.85
CanvasSelectToFunction · 0.85
ConfigureTextFunction · 0.85

Calls 2

SelInitFunction · 0.85
TkCurrentTimeFunction · 0.70

Tested by

no test coverage detected