MathGroup Archive 2002

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

Search the Archive

RE: RE: Re: Seemingly simple gridbox question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37656] RE: [mg37562] RE: [mg37536] Re: Seemingly simple gridbox question
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Thu, 7 Nov 2002 06:43:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Bobby,

>-----Original Message-----
>From: DrBob [mailto:drbob at bigfoot.com]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, November 06, 2002 7:00 PM
>To: 'Wolf, Hartmut'; mathgroup at smc.vnet.net
>Subject: [mg37656] RE: [mg37562] RE: [mg37536] Re: Seemingly simple gridbox
>question
>
>
>Two questions:
>
>First, the following code does exactly the same thing, so what was
>Unevaluated[Sequence[]] intended to do?
>
Essentially I used it (1) as a placeholder for inserting styles for
highlighted and other parts. So you keep the practical flexibility paste in
and need not reconsider the algorithm in any case. (2) the If-Statement is
in place of a _sequence_ of style-specifications (and it _must_ be a
sequence if you want to add further common styles behind (or before). 

 ...,If[s[#2, blockHigh], styleHiglighted, styleOrdinary], stylesCommon,...

The void if-path however delivers Null, and you were lucky that If[s[#2,
blockHigh], FontColor -> Hue[0]] and If[s[#2, blockHigh], ,FontColor ->
GrayLevel[.5]] didn't crash. I'm too busy, to test each function not written
by myself how it behaves outside of their specification. 

So what I did, is just to simply use a design-pattern which works in any
case.


>DisplayForm[
>  GridBox[MapIndexed[
>      StyleBox[ToString[#1], 
>          If[s[#2, blockHigh], FontColor -> Hue[0]]] &, m, {2}]]]
>MatrixForm[
>  MapIndexed[
>    DisplayForm[
>        StyleBox[ToString[#1], 
>          If[s[#2, blockHigh], ,
>            FontColor -> GrayLevel[.5]], FontWeight -> "Bold"]] &, m,
>{2}]]
>

Not recommended!


>Second, if I page up after evaluating the code, so that the output is
>hidden, and then page down again so that I can see it again, the gray
>cells have changed color.  Does anyone else see that, or am I losing my
>mind?  (Mathematica 4.2, WinXP.)

I can't help you with that.

>
>DrBob
>
>-----Original Message-----
>From: Wolf, Hartmut [mailto:Hartmut.Wolf at t-systems.com] 
To: mathgroup at smc.vnet.net
>Sent: Tuesday, November 05, 2002 4:00 AM
>To: mathgroup at smc.vnet.net
>Subject: [mg37656] [mg37562] RE: [mg37536] Re: Seemingly simple gridbox question
>
--snipped--

Hartmut



  • Prev by Date: Re: OO in Mathematica
  • Next by Date: RE: RE: Re: Seemingly simple gridbox question
  • Previous by thread: RE: Re: Seemingly simple gridbox question
  • Next by thread: RE: RE: Re: Seemingly simple gridbox question