Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Scroll view not working
-
Hi newbie here.
I can’t get scrollview to work with the code below. My main sheet loads fine and there is a working vertical scroll bar, but this has no effect on the main sheet. Any ideas?
import math import ui sv = ui.ScrollView() x = int(0) y = int(0) z = int(0) a = int(0) b = int(0) sl1 = float(0) # COURSE OF PAIN def func(sender): global label8 label8 = v["label8"] global x if sender.value == True: x = 0 label8.text = str(x) else: x = 0 label8.text = str(x) def func2(sender): global y label8 = v["label8"] if sender.value == True: y = -1 label8.text = str(y) else: y = 0 label8.text = str(y) def func3(sender): label8 = v["label8"] global z if sender.value == True: z = 1 label8.text = str(z) else: z = 0 label8.text = str(z) # RADIATING PAIN? def func4(sender): label8 = v["label8"] global a if sender.value == True: a = 2 label8.text = str(a) else: a = 0 label8.text = str(a) # symptoms def slinder(sender): label8 = v["label8"] sl1 = (sender.value) * 10 / 2 sl1 = math.ceil(sl1) label8.text = str(sl1) v = ui.load_view() v.present("sheet")
-
@shp It is not easy to help you if we don't have the .pyui file.
Anyway, in your posted code, you define sv as an ui.ScrollView but you don't use it anywhere. -
Thanks, have removed the sv and converted to v= ui.ScrollView(), still no scrolling function.
How do I post the py.ui file as can’t find the script for it.
-
@shp as you have v = ui.load_view(), you don't need v = ui.ScrollView(), do you?
To post an .pyui, you can rename it temporarily as .txt and paste its content in the topic
-
I Added v = ui.ScrollView() in a fit of desperation. Made no difference. A quick question might sort it, in the py.ui file, once I have added a scrollview, does all content (buttons, labels etc) need to be added to a sub view to work in the scroll function.
Really enjoying Pythonista by the way…….. thanks for creating it!
-
@shp sorry for you but I can't help more without the .pyui file, as I don't understand what you want to do.
-
import ui import math x = int(0) y = int (0) z = int(0) a = int(0) sl1 = float(0) sl2 = float(0) sl3 = float(0) sl4 = float(0) sl5 = float(0) sl6 = float(0) sl7 = float(0) pds = int(0) #COURSE OF PAIN def func(sender): global label8 label8= v["label8"] global x if sender.value == True: x=0 label8.text = str (x) else: x=0 label8.text = str (x) def func2(sender): global y label8= v["label8"] if sender.value == True: y =-1 label8.text = str (y) else: y=0 label8.text = str (y) def func3(sender): label8= v["label8"] global z if sender.value == True: z=1 label8.text = str (z) else: z=0 label8.text = str (z) #RADIATING PAIN? def func4(sender): label8= v["label8"] global a if sender.value == True: a=2 label8.text = str (a) else: a=0 label8.text = str (a) #symptoms def slider1(sender): global sl1 label8= v["label8"] sl1 = (sender.value) * 10 /2 sl1 = math.ceil(sl1) label8.text = str (sl1) def slider2(sender): global sl2 label8= v["label8"] sl2 = (sender.value) * 10 /2 sl2 = math.ceil(sl2) label8.text = str (sl2) def slider3(sender): global sl3 label8= v["label8"] sl3 = (sender.value) * 10 /2 sl3 = math.ceil(sl3) label8.text = str (sl3) def slider4(sender): global sl4 label8= v["label8"] sl4 = (sender.value) * 10 /2 sl4 = math.ceil(sl4) label8.text = str (sl4) def slider5(sender): global sl5 label8= v["label8"] sl5 = (sender.value) * 10 /2 sl5 = math.ceil(sl5) label8.text = str (sl5) def slider6(sender): global sl6 label8= v["label8"] sl6 = (sender.value) * 10 /2 sl6 = math.ceil(sl6) label8.text = str (sl6) def slider7(sender): global sl7 label8= v["label8"] sl7 = (sender.value) * 10 /2 sl7 = math.ceil(sl7) label8.text = str (sl7) def paindetect(sender): pds = x + y + z +a + sl1 + sl2 + sl3 + sl4 + sl5 + sl6 + sl7 pds = str (pds) label8= v["label8"] label8.text = 'score =' + str(pds) button1= ui.Button() button1.action = paindetect v = ui.load_view() v.present("sheet")
-
Pyui as text file. Thanks Simon (@shp not working)
[
{
"nodes" : [
{
"nodes" : [], "frame" : "{{872, 49}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func3", "alpha" : 1, "frame" : "{{475, 385}, {51, 31}}", "class" : "Switch", "uuid" : "D30F9226-1BEE-4927-AF46-EA465C7FC916", "value" : false, "name" : "switch1" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{542, 48}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func2", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch2", "uuid" : "1EC9CC30-1479-438F-ADD1-C88F47027677" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{267, 47}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch3", "uuid" : "885A8519-4F64-4C2A-876B-D223AE49315E" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{619, 48}, {238, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "0C1268DB-C0AE-4F4C-94FB-1C93D4148AD2", "class" : "Label", "alignment" : "left", "text" : "Pain attacks with or without pain between them", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label2", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{336, 47}, {183, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "CFDF54CF-A204-4310-AA1F-81B0AFDB2879", "class" : "Label", "alignment" : "left", "text" : "Persistent pain with pain attacks", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label3", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{62, 46}, {197, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "9CE218D9-B2F9-4135-847A-10422071A886", "class" : "Label", "alignment" : "left", "text" : "Persistent pain with slight fluctuations", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label4", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{417, 104}, {51, 31}}", "class" : "Switch", "attributes" : { "uuid" : "1EC9CC30-1479-438F-ADD1-C88F47027677", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch4", "action" : "func4" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{424, 1034}, {169, 42}}", "class" : "Label", "attributes" : { "uuid" : "BD8CA992-3E30-4B89-A809-540A43D13D6A", "corner_radius" : 10, "background_color" : "RGBA(1.000000,0.976471,0.976471,1.000000)", "frame" : "{{425, 384}, {150, 32}}", "border_width" : 5, "custom_attributes" : "\n", "alignment" : "center", "text" : "score", "font_name" : "<System>", "class" : "Label", "name" : "label8", "font_size" : 18 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 223}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider1", "alpha" : 1, "class" : "Slider", "name" : "slider1", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 188}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 6}, {579, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Mark the situation that best describes the course of your pain (pick one)", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{316, 104}, {58, 32}}", "class" : "TextField", "attributes" : { "font_size" : 17, "frame" : "{{400, 484}, {200, 32}}", "spellchecking_type" : "default", "class" : "TextField", "uuid" : "5633F4C5-8C1A-4BEB-8C73-6F03DAA6CBEB", "alignment" : "left", "text" : "Yes", "autocorrection_type" : "default", "name" : "textfield3", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 305.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 433}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 547.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 666.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 783.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 343}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider2", "alpha" : 1, "class" : "Slider", "name" : "slider2", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 470}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider3", "alpha" : 1, "class" : "Slider", "name" : "slider3", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 584.5}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider4", "alpha" : 1, "class" : "Slider", "name" : "slider4", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 701}, {696, 34}}", "class" : "Slider", "attributes" : { "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "class" : "Slider", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 2, "font_name" : "<System>", "corner_radius" : 10, "action" : "slider5", "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "autocorrection_type" : "default", "name" : "slider5", "continuous" : false, "alpha" : 1, "spellchecking_type" : "default", "flex" : "W", "value" : 0, "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?\")", "font_size" : 17, "alignment" : "left", "border_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 943.5}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider7", "alpha" : 1, "class" : "Slider", "name" : "slider7", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 276.5}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you have a tingling or prickling sensation in the area of your pain (like crawling ants or electrical tingling)?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 13 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 401}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Is light touching (clothing, a blanket) in this area painful?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 520}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Do you have sudden pain attacks in the area of your pain, like electric shocks?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 637}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Is cold or heat (bath water) in this area occasionally painful?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 756}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you suffer from a sensation of numbness in the areas that you marked?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 104}, {200, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Does your pain radiate? ", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 872}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Does slight pressure in this area, e.g., with a finger, trigger pain?\")", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 904}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 157}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 822}, {696, 34}}", "class" : "Slider", "attributes" : { "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "class" : "Slider", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 2, "font_name" : "<System>", "corner_radius" : 10, "action" : "slider6", "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "autocorrection_type" : "default", "name" : "slider6", "continuous" : false, "alpha" : 1, "spellchecking_type" : "default", "flex" : "W", "value" : 0, "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?\")", "font_size" : 17, "alignment" : "left", "border_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{194, 1031}, {170, 45}}", "class" : "Button", "attributes" : { "action" : "paindetect", "border_width" : 5, "frame" : "{{460, 1234}, {80, 32}}", "title" : "calculate pd score", "uuid" : "D83FBEB9-BBA3-40F6-8783-4E08EE8619BC", "background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)", "class" : "Button", "corner_radius" : 20, "name" : "button1", "font_size" : 15 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{0, 0}, {1100, 2000}}", "class" : "ScrollView", "attributes" : { "uuid" : "8D302B37-3DE8-45FC-A527-F0F9F30965CD", "frame" : "{{340, 1090}, {320, 320}}", "content_height" : 2500, "class" : "ScrollView", "name" : "scrollview1", "content_width" : 1000 }, "selected" : true } ], "frame" : "{{0, 0}, {1000, 2500}}", "class" : "View", "attributes" : { "flex" : "", "custom_class" : "", "enabled" : true, "tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)", "border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "THE PAIN DETECT APP" }, "selected" : false
}
] -
@shpalmer script not indented, please use </> button and insert your code between the two lines of the 3 back quotes
-
[ { "nodes" : [ { "nodes" : [ ], "frame" : "{{0, 0}, {1100, 1962}}", "class" : "ScrollView", "attributes" : { "uuid" : "8D302B37-3DE8-45FC-A527-F0F9F30965CD", "frame" : "{{340, 1090}, {320, 320}}", "content_height" : 2500, "class" : "ScrollView", "name" : "scrollview1", "content_width" : 1100 }, "selected" : true }, { "nodes" : [ ], "frame" : "{{872, 49}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func3", "alpha" : 1, "frame" : "{{475, 385}, {51, 31}}", "class" : "Switch", "uuid" : "D30F9226-1BEE-4927-AF46-EA465C7FC916", "value" : false, "name" : "switch1" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{542, 48}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func2", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch2", "uuid" : "1EC9CC30-1479-438F-ADD1-C88F47027677" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{267, 47}, {51, 31}}", "class" : "Switch", "attributes" : { "action" : "func", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch3", "uuid" : "885A8519-4F64-4C2A-876B-D223AE49315E" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{619, 48}, {238, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "0C1268DB-C0AE-4F4C-94FB-1C93D4148AD2", "class" : "Label", "alignment" : "left", "text" : "Pain attacks with or without pain between them", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label2", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{336, 47}, {183, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "CFDF54CF-A204-4310-AA1F-81B0AFDB2879", "class" : "Label", "alignment" : "left", "text" : "Persistent pain with pain attacks", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label3", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{62, 46}, {197, 32}}", "class" : "Label", "attributes" : { "font_size" : 10, "frame" : "{{425, 384}, {150, 32}}", "uuid" : "9CE218D9-B2F9-4135-847A-10422071A886", "class" : "Label", "alignment" : "left", "text" : "Persistent pain with slight fluctuations", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "label4", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{417, 104}, {51, 31}}", "class" : "Switch", "attributes" : { "uuid" : "1EC9CC30-1479-438F-ADD1-C88F47027677", "frame" : "{{475, 385}, {51, 31}}", "value" : false, "class" : "Switch", "name" : "switch4", "action" : "func4" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{424, 1034}, {169, 42}}", "class" : "Label", "attributes" : { "uuid" : "BD8CA992-3E30-4B89-A809-540A43D13D6A", "corner_radius" : 10, "background_color" : "RGBA(1.000000,0.976471,0.976471,1.000000)", "frame" : "{{425, 384}, {150, 32}}", "border_width" : 5, "custom_attributes" : "\n", "alignment" : "center", "text" : "score", "font_name" : "<System>", "class" : "Label", "name" : "label8", "font_size" : 18 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 223}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider1", "alpha" : 1, "class" : "Slider", "name" : "slider1", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 188}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 6}, {579, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Mark the situation that best describes the course of your pain (pick one)", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{316, 104}, {58, 32}}", "class" : "TextField", "attributes" : { "font_size" : 17, "frame" : "{{400, 484}, {200, 32}}", "spellchecking_type" : "default", "class" : "TextField", "uuid" : "5633F4C5-8C1A-4BEB-8C73-6F03DAA6CBEB", "alignment" : "left", "text" : "Yes", "autocorrection_type" : "default", "name" : "textfield3", "font_name" : "<System>" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 305.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 433}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 547.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 666.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 783.5}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 343}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider2", "alpha" : 1, "class" : "Slider", "name" : "slider2", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 470}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider3", "alpha" : 1, "class" : "Slider", "name" : "slider3", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 584.5}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider4", "alpha" : 1, "class" : "Slider", "name" : "slider4", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 701}, {696, 34}}", "class" : "Slider", "attributes" : { "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "class" : "Slider", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 2, "font_name" : "<System>", "corner_radius" : 10, "action" : "slider5", "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "autocorrection_type" : "default", "name" : "slider5", "continuous" : false, "alpha" : 1, "spellchecking_type" : "default", "flex" : "W", "value" : 0, "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?\")", "font_size" : 17, "alignment" : "left", "border_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 943.5}, {696, 34}}", "class" : "Slider", "attributes" : { "continuous" : false, "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.623529,1.000000)", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 0, "value" : 0, "action" : "slider7", "alpha" : 1, "class" : "Slider", "name" : "slider7", "flex" : "W" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 276.5}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you have a tingling or prickling sensation in the area of your pain (like crawling ants or electrical tingling)?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 13 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 401}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Is light touching (clothing, a blanket) in this area painful?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 520}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Do you have sudden pain attacks in the area of your pain, like electric shocks?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 637}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : " Is cold or heat (bath water) in this area occasionally painful?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 756}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you suffer from a sensation of numbness in the areas that you marked?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 104}, {200, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Does your pain radiate? ", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 872}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Does slight pressure in this area, e.g., with a finger, trigger pain?\")", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 904}, {696, 39}}", "class" : "TextField", "attributes" : { "uuid" : "C3E651BC-79B1-45C4-8691-31B10D48550F", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.709804,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_width" : 0, "alignment" : "left", "autocorrection_type" : "default", "text" : "never. hardly-noticed. slightly. moderately. strongly. very-strongly", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield2", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 157}, {696, 32}}", "class" : "TextField", "attributes" : { "uuid" : "98A71D98-7E4B-46A2-8917-9889CA606953", "corner_radius" : 10, "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "frame" : "{{400, 384}, {200, 32}}", "border_color" : "RGBA(1.000000,0.478431,0.478431,1.000000)", "border_width" : 2, "alignment" : "left", "autocorrection_type" : "default", "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?", "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "font_name" : "<System>", "spellchecking_type" : "default", "class" : "TextField", "name" : "textfield1", "font_size" : 17 }, "selected" : false }, { "nodes" : [ ], "frame" : "{{53, 822}, {696, 34}}", "class" : "Slider", "attributes" : { "text_color" : "RGBA(1.000000,0.270588,0.270588,1.000000)", "class" : "Slider", "frame" : "{{400, 383}, {200, 34}}", "border_width" : 2, "font_name" : "<System>", "corner_radius" : 10, "action" : "slider6", "uuid" : "F276E893-E1B8-48D1-A2B8-54628490A404", "background_color" : "RGBA(1.000000,1.000000,0.584314,1.000000)", "autocorrection_type" : "default", "name" : "slider6", "continuous" : false, "alpha" : 1, "spellchecking_type" : "default", "flex" : "W", "value" : 0, "text" : "Do you suffer from a burning sensation (e.g., stinging nettles) in the painful areas?\")", "font_size" : 17, "alignment" : "left", "border_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)" }, "selected" : false }, { "nodes" : [ ], "frame" : "{{194, 1031}, {170, 45}}", "class" : "Button", "attributes" : { "action" : "paindetect", "border_width" : 5, "frame" : "{{460, 1234}, {80, 32}}", "title" : "calculate pd score", "uuid" : "D83FBEB9-BBA3-40F6-8783-4E08EE8619BC", "background_color" : "RGBA(1.000000,1.000000,1.000000,1.000000)", "class" : "Button", "corner_radius" : 20, "name" : "button1", "font_size" : 15 }, "selected" : false } ], "frame" : "{{0, 0}, {1000, 2500}}", "class" : "View", "attributes" : { "flex" : "", "custom_class" : "", "enabled" : true, "tint_color" : "RGBA(0.000000,0.478000,1.000000,1.000000)", "border_color" : "RGBA(0.000000,0.000000,0.000000,1.000000)", "background_color" : "RGBA(0.560784,1.000000,0.709804,1.000000)", "name" : "THE PAIN DETECT APP" }, "selected" : false } ] ```
-
@shp As all your ui elements are visible on the screen, why do you want a ScrollView?
All my remarks are about the first .pyui you did post, I don't have checked the new one.
Anyway, your ScrollView is above the ui elements, thus these ones are not touchable.
You should create the ScrollView as first subview of your main ui.View and then put all your elements in this ScrollView.To avoid changing your . pyui, you can try this workaround:
vv = ui.load_view() vv.remove_subview(vv['scrollview1']) v = ui.ScrollView() v.frame = vv.frame v.content_size = (v.width,v.height) v.background_color = vv.background_color for sv in vv.subviews: v.add_subview(sv) del vv v.present("fullscreen")
-
Thanks @cvp
The elements are not visible on landscape mode and different iPads and iPhone and i need this on multiple devices hence the need for scrollview.
I think you have very kindly answered my earlier question on the subviews when setting up a scrollview.
Your workaround works great.
Thanks again
Simon
-