MathGroup Archive 1999

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

Search the Archive

Re: How do I make my own pallettes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17174] Re: How do I make my own pallettes
  • From: paulh (P.J. Hinton)
  • Date: Sun, 18 Apr 1999 23:53:17 -0400
  • Organization: Wolfram Research, Inc.
  • References: <7f9iu6$56q@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <7f9iu6$56q at smc.vnet.net>, Voyager_2 at cable.A2000.nl (Jeffrey A. Soesbergen) writes:

> How can I make my own pallettes in Mathematica?
> 
> For example, I want a button containing the actions
> 
> <<Algebra`
> 
> and 
> 
> InequalitySolve`
> 
> Everytime I have to type this, but I want to make a button
> of it, but how must I do this?

The general subject of button programming in Mathematica
is a topic that could consume a lot of bandwidth.   I would
encourage you to review the short summary of buttons that can be
found 2.10.6 in _The Mathematica Book_ (Third Edition).  If you
read documentation through the Help Browser, you can paste this
expression in a notebook and evaluate it.

FrontEndExecute[FrontEnd`HelpBrowserLookup["MainBook", "2.10.6"]]

Then go download a copy of the ButtonBox HOWTO that demonstrates
the act of designing a nontrivial button through start to finish.

http://www.mathsource.com/Content/General/Tutorials/Programming/0209-809

The type of button you describe evaluates an expression in the 
kernel rather than a front end.  That means that it is important
to set the ButtonEvaluator option to something other than it's 
default value of None. 

ButtonBox[
  "Load Algebra`InequalitySolve`",
  ButtonFunction :> Needs["Algebra`InequalitySolve`"],
  ButtonEvaluator -> "Default",
  Active -> True
] // DisplayForm

This should generate a button with the first argument as the label 
of the button.  The ButtonFunction specifies what operation is to
be performed when the button is clicked.  The ButtonEvaluator is
set to be the the front end's default evaluator, and setting Active
to be True guarantees that the button is turned on.

--
P.J. Hinton	
Mathematica Programming Group		paulh at wolfram.com
Wolfram Research, Inc.			http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.


  • Prev by Date: Re: psfix in 3.02?
  • Next by Date: Re: Display (was: psfix)
  • Previous by thread: How do I make my own pallettes
  • Next by thread: Dsiplay cannot be used during initialization problem