3
$\begingroup$

Writing:

ChoiceDialog["I dati sui nodi sono già stati inseriti?", 
             {sì -> 0, no -> 1},
             Magnification -> 1.5]

I get:

enter image description here

while writing:

ChoiceDialog[ExpressionCell["I dati sui nodi sono già stati inseriti?", 
             ShowStringCharacters -> False], 
             {sì -> 0, no -> 1}, 
             Magnification -> 1.5]

I get:

enter image description here

Given that for some special needs I have to use this last structure, is there any way to automatically lengthen the dialog?

Thank you!



By doing other tests, I noticed that by writing:

ChoiceDialog[ExpressionCell["I dati sui nodi sono già stati inseriti?", 
             LineIndent -> 0, 
             ShowStringCharacters -> False], 
            {sì -> 0, no -> 1},
             Magnification -> 1.5]

I get:

enter image description here

while writing:

ChoiceDialog[ExpressionCell["I dati sui nodi sono già stati inseriti?", 
             LineIndent -> 1, 
             ShowStringCharacters -> False], 
            {sì -> 0, no -> 1},
             Magnification -> 1.5]

I get:

enter image description here

when I would like there to be no indentation but to wrap after "sono". How could I do?

$\endgroup$
2
  • 2
    $\begingroup$ what about ChoiceDialog[ExpressionCell["I dati sui nodi sono già stati inseriti?", ShowStringCharacters -> False, LineBreakWithin -> False], {sì -> 0, no -> 1}, Magnification -> 1.5, WindowSize -> Full] $\endgroup$
    – ktm
    Commented Mar 8, 2018 at 17:42
  • $\begingroup$ Why not use Style instead of ExpressionCell? Also, to control where the linebreak occurs, you could use the option LinebreakAdjustments. $\endgroup$
    – Carl Woll
    Commented Mar 8, 2018 at 20:09

2 Answers 2

1
$\begingroup$

Given that for some special needs I have to use this last structure, is there any way to automatically lengthen the dialog?

The answer is to use WindowSize -> {All, All}. But it won't help because of the bug: Line wrapping in a TextCell within an extensible window.

So either you create your own *Dialog functions that will handle All, which is very annoying since they are already there...

Or you can fix the size of all dialogs for your application so they look consistent. Plus take care about proper linebreaks, see next section.


[...] I would like there to be no indentation but to wrap after "sono" [...]

If you want to control line breaks you need to play with LinebreakAdjustments.

But for common needs you can use predefined wrappers. If you want expr to 'behave' like text use Text or TextCell:

ChoiceDialog[
 TextCell["I dati sui nodi sono già stati inseriti? I dati sui nodi \
sono già stati inseriti? I dati sui nodi sono già stati inseriti?"], \
{sì -> 0, no -> 1}, Magnification -> 1.5]

And if you want a linebreak before sono, put \n just before it. Or use Column and friends.

$\endgroup$
0
$\begingroup$

How about this?

ChoiceDialog["Make a choice", WindowSize -> {933, 93}];
$\endgroup$
1
  • $\begingroup$ Never mind, I guess you want to wrap? $\endgroup$ Commented Mar 26, 2018 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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