MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: RE: : 6.0 Get Graphics Coordinates...


On Thursday 21 June 2007 04:04:35 Ingolf Dahl wrote:
> CreatePalette[
>   Column[{Button["Add LocatorPane",
>      SelectionMove[InputNotebook[], All, CellContents];
>      NotebookWrite[
>       InputNotebook[], (DynamicModuleBox[{$CellContext`pts$$ = {{0.,
>               0.}}}, LocatorPaneBox[Dynamic[$CellContext`pts$$], #,
>            LocatorAutoCreate -> True], DynamicModuleValues :> {}]) &@
>        NotebookRead[InputNotebook[]]]],
>     "Use Alt+Click to add or delete locators!",
>     Button["Copy locator positions",
>      SelectionMove[InputNotebook[], All, Cell];
>      FrontEndExecute[FrontEndToken["Copy"]];
>      SelectionMove[InputNotebook[], All, CellContents];
>      Module[{b}, b = NotebookRead[InputNotebook[]];
>       If[And[Length[b] >= 3, MatchQ[b[[2]], _LocatorPaneBox]],
>        b = b[[1, 1]]; $LocatorPositions = b;
>        SelectionMove[ClipboardNotebook[], All, Notebook];
>        NotebookWrite[ClipboardNotebook[], ToBoxes[b],All];
>        SelectionMove[ClipboardNotebook[], All, Notebook]]]],
>     Button["Remove LocatorPane",
>      SelectionMove[InputNotebook[], All, CellContents];
>      Module[{b}, b = NotebookRead[InputNotebook[]];
>       If[And[Length[b] >= 3, MatchQ[b[[2]], _LocatorPaneBox]],
>        NotebookWrite[InputNotebook[], b[[2, 2]]]]]],
>     Dynamic[MousePosition["Graphics"]]}],
>   WindowTitle -> "Get Graphics Coordinates"];

Your locator code works really well for me, now. KDE users: you must use
ALT+CRTL+CLICK to place the locators!

==========================
==========================
========
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================
==========================
========


  • Prev by Date: Re: Multiple UNDO - a simple proposal
  • Next by Date: Re: Same Limit in v5.2 and v6.0 - conclusion, I hope...
  • Previous by thread: RE: : 6.0 Get Graphics Coordinates...
  • Next by thread: Re: RE: Re: Re: 6.0 Get Graphics Coordinates...