make textbox not editable in mit app inventor 2

608 views
Skip to first unread message

Giriraj Pawar

unread,
May 11, 2019, 6:19:45 AM5/11/19
to MIT App Inventor Forum
I am trying hard to get the scrollbar in the textbox to display logs with time stamps but I need to make it noneditable and able to scroll history logs. Please help me out with it.
Thank you.

Evaldas Latoškinas

unread,
May 11, 2019, 7:56:05 AM5/11/19
to MIT App Inventor Forum
If you mean you want the text fields to not be editable in the app itself, you could use labels instead, which can be found under User Interface -> Label

Right now, I assume you are using TextBox, right? These can indeed be modified by the user, whereas labels remain static unless the code changes them.

For scrolling, you could use the ScrollArangement layouts found under the Layout tab.

As a side note, I'm not sure if right now it is possible to add more Labels via script. It might be that the only solution right now is to create a fixed number of Labels, and fill them with text using scripts. Maybe someone else could clarify on this.

Blacktea

unread,
May 11, 2019, 2:03:54 PM5/11/19
to MIT App Inventor Forum
Set It disabled

Giriraj Pawar

unread,
May 12, 2019, 3:38:57 AM5/12/19
to MIT App Inventor Forum
Right now, I assume you are using TextBox, right? --> Yes.
But I wanted to show logs. Dynamically around 50 lines, each line one under another with scroll. If I use labels, Using 50 labels in a scrollbar layout seems to be a nonfeasible solution. 

I just wanted a display unit which is verticle scrollable when the data goes out of view in the display

Giriraj Pawar

unread,
May 12, 2019, 3:39:50 AM5/12/19
to MIT App Inventor Forum
Then I won't able to scroll the multiple lines which are out of view

TimAI2

unread,
May 12, 2019, 5:00:38 AM5/12/19
to MIT App Inventor Forum
Something like this:

Place a vertical scrolling arrangement and fix the height
Inside that place a label and set height to automatic
The label will scroll once the length(height) of your log exceeds the height of the vertical scrolling arrangement

blocksloglist.png


You don't say where your log data is coming from or in what format, I just created a csv from text blocks to make a list

 

ABG

unread,
May 12, 2019, 2:30:02 PM5/12/19
to MIT App Inventor Forum
A List Picker is scrollable.

Load its Elements from the list of log entries.

ABG

TimAI2

unread,
May 12, 2019, 3:04:12 PM5/12/19
to MIT App Inventor Forum
Yes, but the OP asked for textbox (label).... ;)

ABG

unread,
May 12, 2019, 4:24:14 PM5/12/19
to MIT App Inventor Forum

Sometimes people ask for the wrong thing,
not knowing of something better ...

ABG

ABG

unread,
May 12, 2019, 5:00:03 PM5/12/19
to MIT App Inventor Forum
Attached is a small sample logger for you to try.
ABG

Designer.PNG
logger_to_list.aia
sample run.PNG
blocks.png
Clicked on log.PNG

TimAI2

unread,
May 12, 2019, 5:08:38 PM5/12/19
to MIT App Inventor Forum
very nice ABG :)
Reply all
Reply to author
Forward
0 new messages