Re: Help with Alignment for PasteButtons

*To*: mathgroup at smc.vnet.net*Subject*: [mg89625] Re: Help with Alignment for PasteButtons*From*: m.r at inbox.ru*Date*: Sun, 15 Jun 2008 06:14:14 -0400 (EDT)*References*: <g2qhir$8pp$1@smc.vnet.net>

On Jun 12, 2:00 am, Syd Geraghty <sydgerag... at mac.com> wrote: > Hi all, > > I am trying to clean up a GUI for pasting function options with paste > buttons. > > This is an example of where I am headed: > > optionPalette := > PaletteNotebook[{HoldForm[# "Options"], > Grid[Partition[PasteButton /@ Options[#], 3]]}] &; > optionPalette[Graphics] > > My 1st question is one of Alignment: > > This sorts the options list, aligns it left and gives the PasteButton > labels alphabetically in three columns and tries to solve the padding > problem (not entirely satisfactorily, buttons 56 & 57 could be > unlabeled instead of repeating the start of the list): > > clen = Ceiling[Length[Options[Plot]]/3] > > Grid[Transpose[Partition[Options[Plot], clen, clen, {1, 1}]], > Alignment -> Left] > > This generates the PasteButton grid: > > clen = Ceiling[Length[Options[Plot]]/3] > > Grid[Transpose[Partition[PasteButton /@ Options[Plot], clen, clen, {1, = > 1}]]] > > How would I align the labels left vs centered to make reading the > PasteButton columns easier? > > My 2nd question is how to insert a "," in front of all the pastes to > make it even easier to use this GUI to create syntactically correct > lists of options for a chosen function? > > Note, after a deal of trying this is NOT as easy as it might seem (I > think). The alpha lists should be preserved as in > > , AlignmentPoint -> Center > , AspectRatio -> 1/GoldenRatio > , Axes -> True > , AxesLabel -> None > > Thanks for any advice. > > Cheers .... Syd > > Syd Geraghty B.Sc, M.Sc. > > sydgerag... at mac.com > > My System > > Mathematica 6.0.2.1 for Mac OS X x86 (64 - bit) (March 13, 2008) > MacOS X V 10.5.2 > MacBook Pro 2.33 Ghz Intel Core 2 Duo 2GB RAM This should do what you want: Partition[PasteButton[RawBoxes[RowBox[{",", ToBoxes@ #}]], Alignment -> Left]& /@ Options[Plot], 19, 19, {1, 1}, Null] // Transpose // Grid // Deploy Maxim Rytin m.r at inbox.ru