Re: Re: Question on Dynamic with "DockedCell"
- To: mathgroup at smc.vnet.net
- Subject: [mg104177] Re: [mg104171] Re: [mg104137] Question on Dynamic with "DockedCell"
- From: John Fultz <jfultz at wolfram.com>
- Date: Thu, 22 Oct 2009 02:17:38 -0400 (EDT)
- Reply-to: jfultz at wolfram.com
Ariel: Whoa, there!!! I can't vouch for exactly what WRI support told you, or what may not have worked in your case. But the general statement, as you made it, that "there is a bug that doesn't permit docked cells to behave as expected with dynamic content", is patently false. Dynamic content is used all the time in docked cells in built-in parts of Mathematica. In the most visible example, the help viewer toolbar is absolutely riddled with dynamic content. I'd be happy to discuss more with you about whatever your specific problem was, although I'm pretty busy right now (but if you're coming to the conference, you can track me down there). Jason: I haven't responded to the original post due, in part, to a lack of time, and also I thought that others might be able to answer this question. Adam Griffith's responses are a great place to begin. If you're still having problems, feel free to ping me again. Sincerely, John Fultz jfultz at wolfram.com User Interface Group Wolfram Research, Inc. On Wed, 21 Oct 2009 06:33:33 -0400 (EDT), Ariel SepFAlveda wrote: > Hi Jason: > > I had dynamic content in a docked cell in a M6 application and it stopped > working in M7. I asked for WRI support and they told me that there is a > bug that doesn't permit docked cells to behave as expected with dynamic > content. Thanks for your question as it will make this issue more > important for them. > > Ariel > > -----Original Message----- > From: Jason Ledbetter [mailto:jasonbrent at gmail.com] > Sent: Tuesday, October 20, 2009 4:55 AM > To: mathgroup at smc.vnet.net > Subject: [mg104171] [mg104137] Question on Dynamic with "DockedCell" > > Folk, > I'm attempting to create a dynamically-appearing set of choices/menus > using > ButtonBar in a notebook window but I've been unable to get the desired > affect to date. I've cobbled together the following code which almost does > what I'm looking for but I could use some pointers in getting the rest of > the way. > > The goal here is for the "topMenu" items to appear when the notebook is > first instantiated and for the "secondMenu" option to appear when a > "topMenu" option is selected. As it stands now, I'm having to start with > the > "secondMenu" option pre-defined to a bogus value. > > If I were to abstract my goal some more, I'm trying to figure out how to > dynamically add/remove RowBox items that include ButtonBars from the > notebook based on options that are selected. > > I'm guessing that I somehow need to programmatically generate the contents > of a Dynamically wrapped RowBox (e.g., Dynamic[RowBox[...]]) but I'm not > quite sure how to go about that just yet. > > Any help is greatly appreciated... > > Here's what I have thus far: > > --snip-- > Module[ > > {topMenu, secondMenu}, > > topMenu = {"option1", "option2"}; > secondMenu = {"No option selected"}; > > menuChoice[choice_] := Module[{}, > Switch[choice, > "option1", secondMenu = {"one", "selected"}, > "option2", secondMenu = {"two", "selected"}, _, Print[choice] > ]]; > > CreateWindow[DockedCells -> Cell[ > RowBox[ > { > ToBoxes[ > ButtonBar[ToString[#] :> menuChoice[#] & /@ topMenu] > ], > ToBoxes[ > Dynamic[ > ButtonBar[ToString[#] :> menuChoice[#] & /@ secondMenu] > ] > ] > } > ], > "DockedCell"], > TextAlignment -> Center > ] > ]; > > --snip-- > > > thanks, > > > -jbl