Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I've tried the following code to change the FieldSize but I can't make it equal the actual value of MenuSize and I tried to remove first Delimiter but I can't.

ActionMenu["PopupMenu", 
 Flatten@Table[{Delimiter, lable1}, {ittration3, 1, 3}], 
 Appearance -> "PopupMenu", Enabled -> True, 
 Background -> RGBColor[0.235, 0.486, 0.768], FieldSize -> 6]

And please tell me how to change the background color of the field.

share|improve this question
    
Use Riffle[{"Label1", "Label2", "Label3"}, Delimiter] to introduce delimiters only between labels. –  István Zachar Dec 21 '12 at 16:35

3 Answers 3

up vote 1 down vote accepted

On Mathematica 9 (OSX), Background doesn't colour the default PopupMenu button, it just colours the background around the button. Here's a manual version:

act = Rest[
   Flatten@Table[{Delimiter, "label " <> ToString[i]}, {i, 1, 3}]];

am = ActionMenu["PopupMenu", act, Appearance -> None, 
   Background -> RGBColor[0.235, 0.486, 0.768], 
   ImageSize -> {150, 32}, FieldSize -> 10.83];

popup = Graphics[{LightBlue, Rectangle[{0, 0}, {170, 32}],
    Inset[am, {75, 16}, Center, {150, 32}],
    Inset[Style["\[FilledUpTriangle]", Black, 9], {160, 21}, Center],
    Inset[Style["\[FilledDownTriangle]", Black, 9], {160, 11}, Center],
    Black, Line[{{0, 1}, {169, 1}, {169, 32}, {0, 32}, {0, 1}}]},
   PlotRange -> {{0, 170}, {0, 32}}, ImageSize -> 170];

popup

enter image description here

share|improve this answer
    
I tried your idea but i want that dropdown list size should be same as PopupMenu's size and i want dropdown marker next to string("PopupMenu") . –  niren Dec 21 '12 at 11:02
    
@niren - I have edited my answer, matching the sizes using FieldSize for the popup fields, and ImageSize for the button. I also included a dropdown marker. –  Chris Degnen Dec 21 '12 at 19:31

You can do this with PopupMenu. Try this code.

popupMenuValue = "PopupMenu";
{PopupMenu[Dynamic[popupMenuValue], 
    {"Label1", "Label2", "Label3"}, 
    "",
    Row[{Panel[Style["PopupMenu", White], 
                  Background -> RGBColor[0.235, 0.486, 0.768],
                  Alignment -> Center,
                  ImageSize -> {180, 60}], 
         Panel[Style["∨", White], 
                  Background -> RGBColor[0.235, 0.486, 0.768], 
                  ImageSize -> {30, 60},
                  Alignment -> Center]}], 
    MenuStyle -> {25, Blue}, Alignment -> Center, Appearance -> None], 
Dynamic[popupMenuValue]}
share|improve this answer
    
I don't understand what you intend to accomplish by wrapping your PopupMenu expression in a list with Dynamic[popupMenuValue]. –  m_goldberg Dec 21 '12 at 18:31
    
what I am trying ,dynamically we can do all computation's by using PopupMenu instead of ActionMenu –  subbu Dec 22 '12 at 9:07

Is this what you mean you want? Use Full to obtain the Full size

act = Table[{Delimiter, lable1}, {ittration3, 1, 3}];

ActionMenu["PopupMenu",
 Flatten@act,
 Appearance -> "PopupMenu",
 Enabled -> True,
 Background -> RGBColor[0.235, 0.486, 0.768],
 FieldSize -> Full]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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