movement of icons


I defined an IconBox somewhat smaller than the screen size. The icons are placed correctly in this box in the order specified with IconFill.

But I have some questions:

  • is it possible to prevent users from moving icons (dragging with mouse)out of the IconBox?
  • is it possible to prevent users moving icons on top of each other (so no overlapping icons)?

If above is not possible, would it perhaps be possible to prevent movement of icons in general?


Not easily. I suppose you could try and look at it from which context the icon would be placed (i.e. the root window) and then disallow that.



Mouse 0 I A FuncCheck

DestroyFunc FuncCheck
AddToFunc FuncCheck
+ D Iconify
+ H Nop
+ M Nop

– Thomas Adam

Thanks! I’ll try that first thing tomorrow morning (and read the man page to understand what this exactly means).


Alternatively, I could just tell you… :slight_smile: The first line, says that “For any mouse button that is clicked on an icon, run the function named ‘FuncCheck’”. In FuncCheck all that happens is that if the icon is double-clicked (D), then it is deiconified. If the button is held (H) then no action takes place (does nothing). If the user attempts to move (M) the icon, that too does nothing (Nop).

– Thomas Adam

I already figured that out myself, but thanks anyway.