Subscribe Bookmark RSS Feed

How to prevent horizontal shifting (side-by-side display boxes)

djhanson

Community Trekker

Joined:

Jun 23, 2011

Hi, does anyone know of any display box (of any type) in which I can give it a constant width (pixels)?

I've got 2 global boxes placed horizontally, but as the first one (left one) updates it horizontally shifts the second (right one).  I'm trying to prevent this by wrapping each around maybe another display box that takes a constant width (and make it much wider than the global box text that updates).  Any thoughts?  dj

e.g.

Hlistbox(globalbox(var1),globalbox(var2));  //how to prevent updating of var1 from horiztonally shifting to the right of the var2 updating and text output?

2 REPLIES
hlrauch

Community Trekker

Joined:

Sep 19, 2014

Here's one solution. There may be some smarter solutions out there.

A spacer box creates a flexible or fixed-size space in the layout. Place a very wide spacer box below the globalbox (within a V list box) to reserve a fixed amount of horizontal space.

var1 = 11;

var2 = 22;

New Window( "Side-by-Side Display Boxes",

  Hlistbox(

    Vlistbox(

      globalbox(var1),

      spacerbox( size(100, 1) )

    ),

    Vlistbox(

      globalbox(var2),

      spacerbox( size(100, 1) )

    ),

  )

);

Will that work?

Howard

thickey1

Community Trekker

Joined:

Jun 4, 2015

Couple of suggestions to play around with:

// This is more appropriate when you are resizing a window and want to keep things constant but may be of value

newWindow("Test",

lineupBox(nCol(1),

  tabBox("My Tab",

  textEditBox("", << setWidth(300))),

  scriptBox("", "Text", << setAutoStretching(0,0))

);

);