jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 67 forks source link

context Manager and setPaneSashPosition #610

Open hellowtisch opened 4 years ago

hellowtisch commented 4 years ago

With the following code, the method setPaneSashPosition is ignored.

add panedFrame

        with app.panedFrame("mainPanedFrame"):

            with app.panedFrame("p0", vertical=True):
                app.setPaneSashPosition(30)
                app.addLabel("test1", "Test in new Pane")
            with app.panedFrame("p1", vertical=True):
                app.setPaneSashPosition(100)
                app.label("batLabel", "Battery Level", 0,0,fg="white")
                app.meter("battery-level",1,0, fill="green")
                app.label("battStatus","",fg="white", stretch="row", sticky="ew")

            with app.panedFrame("p2"):

                app.addLabelEntry("Inspection-Reference", 1,1)
                app.label("dummyLabel","This is a test" ,0,0,2, bg="red", fg="white")

What can I do to set the Sash when using the WITH method instead of app.startPanedFrame()?

jarvisteach commented 4 years ago

In the next release, you can set a sash argument on the with. I'm not sure if that's in the current release.

Although, I do find the setting of sash positions to be a bit flaky....