1
$\begingroup$

Here is the simplified version of the problem:

THIS: {1,2,##&[],4,5} RETURNS: {1,2,4,5}

AND THIS: x=##&[]; {1,2,Dynamic[x],4,5} RETURNS: {1,2,StandardForm,4,5}

I want to hide"StandardForm"when the dynamic variable"x"is equal to"##&[]".

Here is the full version of the code I am working with:

Column[{
    Panel["Panel 1"],
    Panel["Panel 2"],
    Annotation[Panel["Panel 3"], Panel["Extra Panel"], "Mouse"],
    Dynamic[MouseAnnotation[## &[]]],
    Panel["Panel 4"]
}, Spacings -> {0, 0}]

Here I want to create a column of 4 equally spaced panels where if I mouse over panel 3, an extra panel appears in between panels 3 and 4.

If I use"##&[]"it returns"Null"in between panels 3 and 4. If I use""instead, it returns a blank space in between panels 3 and 4, but the space is larger than the rest found in the column.

Is there a solution or work around to this problem?

$\endgroup$
3
$\begingroup$
Column[{Panel["Panel 1"], Panel["Panel 2"], 
  Mouseover[Panel["Panel 3"], Column@{Panel["Panel 3"], Panel["Extra Panel"]}], 
  Panel["Panel 4"]}, Spacings -> {0, 0}]

enter image description here

Or

Column[{Panel["Panel 1"], Panel["Panel 2"], 
  Dynamic@If[CurrentValue["MouseOver"], 
       Column@{Panel["Panel 3"], Panel["Extra Panel"]}, Panel["Panel 3"]], 
  Panel["Panel 4"]}, Spacings -> {0, 0}]
$\endgroup$
  • $\begingroup$ Thank you for the quick reply! It is functional, but the unequal spacing still remains. This method also introduces a pixel shift which I am not too happy about. Modifying your code a bit I was able to remove the extra space in the column, but the pixel shift during rollover still remains. Column[Join[{Panel["Panel 1"],Panel["Panel 2"]},{Mouseover[Panel["Panel 3"],Column[{Panel["Panel 3"],Panel["Extra Panel"]},Spacings->{0, 0}]]},{Panel["Panel 4"]}],Spacings->{0, 0}] $\endgroup$ – user12572 Mar 19 '15 at 19:05
  • $\begingroup$ @user12572, my pleasure. I don't know what "pixel shift" is; can you pls explain? $\endgroup$ – kglr Mar 19 '15 at 19:18
  • $\begingroup$ ... does it help if you use Pane[#, ImageSize -> {Automatic, 200}] & to wrap the Column[...]? or just add BaselinePosition -> Top to Column? $\endgroup$ – kglr Mar 19 '15 at 19:28
  • $\begingroup$ Yes! Thank you <3 $\endgroup$ – user12572 Mar 19 '15 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.