Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Generate a palette with a FrontEnd Token

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60370] Re: Generate a palette with a FrontEnd Token
  • From: Cca <cca at gregosetroianos.mat.br>
  • Date: Wed, 14 Sep 2005 03:27:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Tom De Vries

>I was wondering if it was possible to generate a palette with a
>FrontEnd token command.

You  mean using only the FrontEnd?

Below I give four examples of buttons that do not require the kernel. (I´m
running Mathematica 5.1.)

----------------------------------
Example 1:

Opening the BasicTypesetting palette:
 
ButtonBox["Test1",
    ButtonFunction:>NotebookOpen["BasicTypesetting.nb"],
    ButtonEvaluator->None,
    Active->True]//DisplayForm
----------------------------------
Example 2:

Now using FrontEndExecute:

ButtonBox["Test2",
    ButtonFunction:>
      FrontEndExecute[{FrontEnd`NotebookOpen["BasicTypesetting.nb"]}],
    ButtonEvaluator->None,
    Active->True]//DisplayForm
----------------------------------
Example 3:

Like the previous, except that we drop FrontEnd`:

ButtonBox["Test3",
    ButtonFunction:>
      FrontEndExecute[{NotebookOpen["BasicTypesetting.nb"]}],
    ButtonEvaluator->None,
    Active->True]//DisplayForm

If I remember correctly, this does not work in versions 4.0 and 4.1.
----------------------------------

Example 4:

A simple horizontal palette with two buttons:

ButtonBox["Test4",
    ButtonFunction:>
      NotebookPut@
        Notebook[{Cell[BoxData[GridBox[{{ButtonBox["1"],ButtonBox["2"]}}]]]},
          WindowSize->{Fit,Fit},WindowElements->{},
          ShowCellBracket->False,WindowFrame->"Palette",
          WindowClickSelect->False,
           CellMargins->{{0,0},{0,0}},
           WindowFrameElements->"CloseBox",
          GridBoxOptions->{ColumnSpacings->0,RowSpacings->0}],
    ButtonEvaluator->None,
    Active->True]//DisplayForm
----------------------------------


Carlos César de Araújo
Gregos & Troianos Educacional
www.gregosetroianos.mat.br
Belo Horizonte, MG, Brasil
(31) 3283-1122


  • Prev by Date: Re: Options in user-defined functions...
  • Next by Date: Re: Forums opened on Mathematica-users.org
  • Previous by thread: Generate a palette with a FrontEnd Token
  • Next by thread: smooth eigenvalues and eigenvectors as a function of frequency