3
$\begingroup$

I'm using the ListPicker function within an Input dialog in Wolfram Language to allow users to select one item of a list. However, I've encountered an issue where all the items in the ListPicker appear highlighted in blue initially, which I would like to avoid.

enter image description here

Here's a simplified version of my code:

 Input[Text[Style["Pick one of the obtained equilibria", 16]], DynamicModule[{sol = { {x1 -> 1, x2 -> 0}, {x1 -> (d α)/(c - d), x2 -> (r α (c - d - d α))/(c - d)^2}, {x1 -> 0, x2 -> 0}}, parpicker = {}}, {ListPicker[Dynamic[parpicker], sol], Dynamic[parpicker]}]] 

When the dialog appears, all items in the ListPicker are highlighted in blue until I click on an item with the cursor.

Is there a way to modify this behavior so that no items are highlighted initially when the dialog appears? I would prefer the items to appear without any selection or highlighting by default.

Thanks in advance for any suggestion!

$\endgroup$

1 Answer 1

2
$\begingroup$

You shouldn't be using Input for this. Use DialogInput instead, for example:

DynamicModule[{sol = {{x1 -> 1, x2 -> 0}, {x1 -> (d α)/(c - d), x2 -> (r α (c - d - d α))/(c - d)^2}, {x1 -> 0, x2 -> 0}}, parpicker = {}}, DialogInput[DialogNotebook[{ TextCell@"Pick one of the obtained equilibria", ListPicker[Dynamic[parpicker], sol], Dynamic[parpicker], Row[{CancelButton[DialogReturn[False]], DefaultButton[DialogReturn[parpicker]]}]}]] ] 
$\endgroup$
1
  • $\begingroup$ Hello, @Domen! I extend my sincere thanks for your detailed and insightful response to my recent question. I just learned a lot from this approach you used, it solves my problem perfectly. $\endgroup$ Commented Jul 1, 2024 at 9:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.