3
$\begingroup$

Writing:

DialogInput[DialogNotebook[
                                                  {Style[Row[{

      Style["                   Struttura2D",
       FontColor -> Red,
       FontFamily -> "Consolas",
       FontSize -> 16,
       FontWeight -> "Bold"],

      Text[
       Style["SISTEMA DI RIFERIMENTO GLOBALE: asse delle x di \
direzione orizzontale che 
        punta verso destra, asse delle y di direzione verticale che \
punta verso l'alto, asse 
        delle z ortogonale al piano <x,y> che individua in esso \
rotazioni positive se in sen-
        so antiorario.", LineIndent -> 0, TextAlignment -> Left]]

                                            }],
                                                FontFamily -> "Times"],
                                                 Style[DefaultButton[],

    TextAlignment -> Center]},

  Background -> LightBlue,
                                                  Magnification -> 1.5,

  ShowStringCharacters -> False],

 WindowSize -> {700, 200}]

I get:

enter image description here

where it is evident that the window is not high enough.

The easiest method is clearly to increase the height, but if for some needs I could not increase the height and would like to introduce a vertical scrollbar would be possible?

I tried to look but I did not find anything. Thank you!

$\endgroup$
  • $\begingroup$ Have you tried to search documentation for 'scrollbars' and related keywords? See WindowElements for notebooks or Scrollbars for Pane. $\endgroup$ – Kuba Mar 11 '18 at 21:43
3
$\begingroup$

This is the closest I can get to what I think you want.

In Mathematica, the way to add a scrollbar to a GUI element such as a window is to use Pane which allows scrollbar and resize area widgets to be specified as appearance elements.

DialogInput[
  DialogNotebook[
    Pane[
      Column[
        {Style["Struttura2D", FontColor -> Red, FontFamily -> "Consolas", 
           FontSize -> 16, FontWeight -> "Bold"],
         Pane[
           Style["SISTEMA DI RIFERIMENTO GLOBALE: asse delle x di \
direzione orizzontale che punta verso destra, asse delle y di \
direzione verticale che punta verso l'alto, asse delle z ortogonale \
al piano <x,y> che individua in esso rotazioni positive se in senso \
antiorario.",
             LineIndent -> 0, TextAlignment -> Left, FontFamily -> "Times"]],
         DefaultButton[]}, 
        Alignment -> {Center, Center}],
      Scrollbars -> {False, True},
      ImageSize -> {200, 100}],
    Background -> LightBlue,
    Magnification -> 1.5,
    ShowStringCharacters -> False]]

The dialog comes up looking like this

initial

It can be scrolled up to reveal the button

scrolled

or it can be resized to reveal it.

resized

$\endgroup$
  • $\begingroup$ Thanks, impeccable! $\endgroup$ – TeM Mar 15 '18 at 6:11

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.