Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8594 > unrolled thread
| Started by | Don <donabc@comcast.net> |
|---|---|
| First post | 2012-02-18 11:30 +0000 |
| Last post | 2012-02-20 07:44 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
PopupWindow Problem Don <donabc@comcast.net> - 2012-02-18 11:30 +0000
Re: PopupWindow Problem A Retey <awnl@gmx-topmail.de> - 2012-02-19 11:28 +0000
Re: PopupWindow Problem David Bailey <dave@removedbailey.co.uk> - 2012-02-20 07:44 +0000
| From | Don <donabc@comcast.net> |
|---|---|
| Date | 2012-02-18 11:30 +0000 |
| Subject | PopupWindow Problem |
| Message-ID | <jho24f$5t1$1@smc.vnet.net> |
Here is a Popup Window
thisContent = Style["Max. No. on Graph", Bold];
PopupWindow["xxx", thisContent, Background->LightYellow]
I would like to add to thisContent an explanation of what "Max. No. on Graph" means
in Plain text.
For example:
"Max. No. on Graph - This option means ... "
where only "Max. No. on Graph" is in Bold and
"This option means ... " is in Plain text.
The simple, intuitive solution,
thisContent = StringJoin[Style["Max. No. on Graph", Bold], " This option means... "]
does not work.
thisContent = {Style["Max. No. on Graph", Bold], " This option means ... "};
PopupWindow["xxx", thisContent, Background->LightYellow]
and
thisContent = {Style["Max. No. on Graph", Bold], " This option means ... "};
thisContent = Apply[Sequence, thisContent];
PopupWindow["xxx", thisContent, Background->LightYellow]
do not work either.
How can I do this?
Thank you in advance.
[toc] | [next] | [standalone]
| From | A Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2012-02-19 11:28 +0000 |
| Message-ID | <jhqmde$f6n$1@smc.vnet.net> |
| In reply to | #8594 |
Hi,
>
> thisContent = Style["Max. No. on Graph", Bold];
> PopupWindow["xxx", thisContent, Background->LightYellow]
>
> I would like to add to thisContent an explanation of what "Max. No. on Graph" means
> in Plain text.
>
> For example:
>
> "Max. No. on Graph - This option means ..."
> where only "Max. No. on Graph" is in Bold and
> "This option means ... " is in Plain text.
>
>
> The simple, intuitive solution,
>
> thisContent = StringJoin[Style["Max. No. on Graph", Bold], " This option means... "]
>
> does not work.
> ...
> How can I do this?
Row is your friend, you can think of it as a StringJoin for stuff that
isn't strings...
thisContent =
Row[{Style["Max. No. on Graph", Bold], " This option means ... "}];
PopupWindow["xxx", thisContent, Background -> LightYellow]
hth,
albert
[toc] | [prev] | [next] | [standalone]
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Date | 2012-02-20 07:44 +0000 |
| Message-ID | <jhstk9$nfv$1@smc.vnet.net> |
| In reply to | #8594 |
On 18/02/2012 11:30, Don wrote:
>
> The simple, intuitive solution,
>
> thisContent = StringJoin[Style["Max. No. on Graph", Bold], " This option means... "]
>
Well it is only intuitive if you don't realise that Mathematica strings
don't carry style information in them - so Style["Max. No. on Graph",
Bold] can't be a string - which is why the diagnostic complains about
the first argument to StringJoin.
You can discover the type of object this is thus?
Style["Max. No. on Graph", Bold] // Head
You will get what you want by using:
Row[{Style["Max. No. on Graph", Bold], " This option means... "}]
> does not work.
>
>
> thisContent = {Style["Max. No. on Graph", Bold], " This option means ... "};
> PopupWindow["xxx", thisContent, Background->LightYellow]
>
> and
>
> thisContent = {Style["Max. No. on Graph", Bold], " This option means ... "};
> thisContent = Apply[Sequence, thisContent];
> PopupWindow["xxx", thisContent, Background->LightYellow]
>
> do not work either.
>
> How can I do this?
As you have discovered, if you don't learn some of the basics of
Mathematica, there are an almost infinite number of 'plausble' ways to
achieve something - none of which work!
Look at the front page of the documentation centre, and look on the
toolbar for a book icon. This takes you to a virtual book. It is well
worth studying sections of this to get a better grasp of Mathematica. As
with the regular help system, you can cut and paste examples into a
notebook and modify them - an excellent way to learn!
David Bailey
http://www.dbaileyconsultancy.co.uk
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web