Change orientation of boxlayout to vertical in kv file

50 views
Skip to first unread message

Rick Smith

unread,
Jul 22, 2020, 10:02:38 AM7/22/20
to Kivy users support
Hello All:

I have the following kv file with 3 tabs one has a boxlayout with some labels and textinputs, the orientation appears to be horizontal, I want to change it to vertical so I did this
BoxLayout
          orientation:'vertical'

This is thowing
     if current_property[:3] == 'on_':
 TypeError: 'NoneType' object is not subscriptable

How can I change the orientation?

Thanks
Using win10 and Python3.7 64bit

Elliot Garbus

unread,
Jul 22, 2020, 10:15:29 AM7/22/20
to kivy-...@googlegroups.com

I’m  guessing there is an issue not related to orientation.

You are missing the colon after BoxLayout.

 

If you need more assistance, post a runnable example.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/1a2e9b47-6fae-47db-a06f-bcf58eece0d9o%40googlegroups.com.

 

Rick Smith

unread,
Jul 22, 2020, 11:07:49 AM7/22/20
to Kivy users support

Eliot:

Thanks I added the colon, no go here is what I am using
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.tabbedpanel import TabbedPanel
from kivy.lang import Builder
Builder.load_string("""

<PanelTest>:
    size_hint: .5, .5
    pos_hint: {'center_x': .5, 'center_y': .5}
    do_default_tab: False

    TabbedPanelItem:
        text: '123'
        BoxLayout:
                orientation: 'vertical'
            Label:
                text: 'First Name:'
            TextInput:
            Label:
                text: 'Last Name:'
            TextInput:
    TabbedPanelItem:
        text: 'Two'
        BoxLayout:
            Label:
                text: 'Second tab content'
            Button:
                text: 'A button'
    TabbedPanelItem:
        text: 'Three'
        RstDocument:
            text:
                '\\n'.join(("Hello", "-----------",
                "You are in the third tab."))

""")
class PanelTest(TabbedPanel):
    pass
class MyPanelApp(App):
    def build(self):
        return PanelTest()
if __name__ == '__main__':
    app = MyPanelApp()
    app.run()

Elliot Garbus

unread,
Jul 22, 2020, 11:18:02 AM7/22/20
to kivy-...@googlegroups.com

The line with orientation was not properly indented.

 

 

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
from kivy.uix.tabbedpanel import TabbedPanel
from kivy.lang import Builder
Builder.load_string(
"""


<PanelTest>:
    size_hint: .5, .5
    pos_hint: {'center_x': .5, 'center_y': .5}
    do_default_tab: False

    TabbedPanelItem:
        text: '123'
        BoxLayout:
            orientation: 'vertical'  # This was not properly indented,  tab perhaps?
\\n'.join(("Hello", "-----------",
)

From: Rick Smith
Sent: Wednesday, July 22, 2020 8:08 AM
To: Kivy users support

--

You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.

Rick Smith

unread,
Jul 22, 2020, 12:13:58 PM7/22/20
to Kivy users support
Yeah that was it

Thanks

On Wednesday, July 22, 2020 at 10:02:38 AM UTC-4, Rick Smith wrote:
Reply all
Reply to author
Forward
0 new messages