Message Boards Message Boards

PopupMenu over a table-like graphic

Posted 2 years ago

Hi all. I'm a newbie trying to construct a graphical control and have a relatively simple question. The code below works well enough to illustrate the idea but is obviously not ready for prime time. Underlying this is a general question about arrays of graphical elements: there seem to be tons of examples of graphics similar to this, from Grid to GraphicsColumn to MatrixPlot and so on. Can anyone point me to a discussion of these similar but different elements, when and why one might choose one approach over another?

Problem 1: the entire control reformats on mouseover. What I'd prefer is for the PopupMenu to pop up in a layer over the rest of the control so that the control itself doesn't reformat.

Problem 2: the bounding boxes kinda look right but it's not really a grid of squares as it would be with something like a Grid of Button.

Thanks in advance! Allan

Code:

(*MyPopupMenu*)
MyPopupMenu[val_] := 
  Mouseover[val, 
   PopupMenu[x, {"same", "menu", Delimiter, "for each box"}, 
    "click to choose"]];
MakeColumn[name_, values_] := 
  Column[{Column[{Rotate[name, Pi/2]}], 
    Column[MyPopupMenu[#] & /@ values, 
     Background -> {Red, Green, Blue}]}, BaselinePosition -> Bottom];
Row[{MakeColumn["good_morning", {1, 2, 3}], 
  MakeColumn["frens", {"!", "@", "#"}], 
  MakeColumn["omg_ponies", {9, 8, 7}]}]

POSTED BY: A Cooper
Posted 2 years ago

Seems like setting the Column Option ItemSize=1 produces the result I was expecting.

Column[MyPopupMenu[#]&/@values,Background->{Red,Green,Blue},ItemSize->1]
Attachments:
POSTED BY: A Cooper
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract