Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subwindows and Main Window don't match #620

Open
jeffkitson-music opened this issue May 15, 2020 · 3 comments
Open

Subwindows and Main Window don't match #620

jeffkitson-music opened this issue May 15, 2020 · 3 comments

Comments

@jeffkitson-music
Copy link

Bug Report


If main window boilerplate code is applied to subwindows, the result is not the same.

Context


In creating subwindows, it is more difficult to create a clean look, because if the boilerplate code from the main window is applied to the subwindow the result is not the same.

This reminds me of WYSIWYG - What you code is what you (should) see.

Expected Behaviour


Code on the main window should produce the same result in subwindows.

Actual Behaviour


  • Subwindow is smaller,

  • label color is not stretchy,

  • and buttons not padded/spaced as on the main window.

appjar_window_compare

Sample code, demonstrating the issue


from appJar import gui

def press():
    print("User:", app.entry("Username"), "Pass:", app.entry("Password"))
    app.showSubWindow("Window2")

with gui("Login Window", "400x200", bg='orange', font={'size':18}) as app:
    app.label("Welcome to appJar", bg='blue', fg='orange')
    app.entry("Username", label=True, focus=True)
    app.entry("Password", label=True, secret=True)
    app.buttons(["Submit", "Cancel"], [press, app.stop])

    with app.subWindow("Window2", "Window2", "400x200", bg='orange', font={'size': 18}):
        app.setSize(400, 200)
        app.label("Welcome to appJar2", bg='blue', fg='orange')
        app.entry("Username2", label=True, focus=True)
        app.entry("Password2", label=True, secret=True)
        app.buttons(["Submit2", "Cancel2"], [press, app.stop])

Version Information


I am running the most current version. 0.94.0

Personal Note


I love appjar, and this is in no way a criticism. I'm only wondering why code on one window does not work on subsequent windows..

@fullmacht
Copy link

Try to customize Grid Layout for buttons and size of window. Maybe there is parameter for label. All of this you can find on appJar website.

@jeffkitson-music
Copy link
Author

Thanks for your reply! I have successfully solved the problem in my own scripts with grid layout, etc. I submitted the report because new programmers may find the above frustrating when starting a new project - "Why does this look great on the main window but not on the subwindows?"

What I'm saying is this is not a problem that should have to be figured out without either a fix or further explicit instructions in boilerplate code.

@jarvisteach
Copy link
Owner

@jeffkitson-music thanks for raising this and @fullmacht thanks for trying to help.

You're right, sub windows don't behave the same as the main window. This is left over from the early days, when subWindows were intended for something slightly different. I was sure I had a section in the documents mentioning this, but having just looked through, I couldn't find it...

Ultimately, they've been configured to have a different default layout (for reasons I can barely remember) - it is possible to change the layout (as it sounds you've worked out) but that's a faff, especially for beginners.

I think the docs need updating to make this more obvious, and perhaps a flag could be introduced, to allow you to easily match the main GU layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants