Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

RE: Re: 6.0 Get Graphics Coordinates...


Hi Alessandro,
I am not sure you have done it in the right way. It would be correct for a
palette distributed as notebook, but sounds not correct for this palette,
given by code for palette creation.
Try: 
1. Copy the code into a cell in a Mathematica notebook. Please use the
latest code, from mg78046 (also given below). 
2. Run the code to create the palette.
3. Move the palette to another position on the screen. (This point is not
logical, it is just Mathematica 6.0.0 magic. This will probably be corrected
before version 17.2.4)
4. Try to close the palette. If Mathematica behaves as it should, you should
be questioned if and where to save the palette. I think you have an
"Applications" folder somewhere, check the value of $UserBaseDirectory to
see where. Create there a subdirectory chain "Palettes/FrontEnd/Palettes,
and save the file there.
5. Close Mathematica and reopen it. If the palette does not appear in the
palette list, then do Install palette...
6. If Mathematica crashes during on of these steps, try again one or two
times. Mathematica 6 is fantastic, but occasionally has crashed some times
for me. But be confident, such behavior will be eliminated in version 6.0.1,
arriving soon ;)
Best regards

Ingolf Dahl

Here is the new code again:

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"];
   
> -----Original Message-----
> From: alexxx.magni at gmail.com [mailto:alexxx.magni at gmail.com] 
> Sent: den 21 juni 2007 11:39
> To: mathgroup at smc.vnet.net
> Subject: [mg77996] Re: 6.0 Get Graphics Coordinates...
> 
> This is a beautiful solution!
> Can you please help me to understand how to install it under 
> the "Palettes" menu?
> If I do simply Install Palette -> From Clipboard (after 
> having copied there your code) it crashes Mathematica with SIGSEGV ...
> 
> thanks!
> 
> Alessandro Magni




  • Prev by Date: Re: Integrate modified in version 6?
  • Next by Date: Re: Re: PrimePi and limit of argument
  • Previous by thread: Re: 6.0 Get Graphics Coordinates...
  • Next by thread: Re: : 6.0 Get Graphics Coordinates...