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

Can't set subWindow size #648

Open
bleechmasta opened this issue Jul 17, 2022 · 0 comments
Open

Can't set subWindow size #648

bleechmasta opened this issue Jul 17, 2022 · 0 comments

Comments

@bleechmasta
Copy link

Bug Report

It isn't possible to resize a subWindow, at least consistently without changing other undesirable settings

Context

I'm trying to make an application that requires a large GUI feature as a subWindow, so only people with certain privileges can use the window, and other users see another window, while having the ability to log out and be taken back to the login screen (I could use a loop, but that breaks things even more)

Expected Behaviour

app.startSubWindow() should have a size flag (from what I've seen from other code examples), AND should be able to be manipulated using app.setSize() as a last resort.

Actual Behaviour

app.startSubWindow has no size flag, and instead inherits the original window's size. I've also tried using app.setSize() inside of the subWindow's initialisation, AND outside (before and after) the subWindow's initialisation, and the results make no sense to me. calling app.setSize() BEFORE app.startSubWindow() changes the subWindow, but leaves the mainWindow unchanged, which tells me that it is completely broken.

CODE:

    #creating the opening login/signup screen. the 'mode' parameter determines whether login or signup buttons are used
    self.app = appJar.gui("Login Window", "1280x720")
    self.app.setBg("white")
    self.app.setFont(18)
    self.app.addLabel("title", "Nick Industries' employee manager")
    self.app.setLabelBg("title", "white")
    self.app.setLabelFg("title", "red")
    self.app.getLabelWidget("title").config(font="Times 22 italic")
    self.app.addLabelEntry("Username")                                                 # size is changed here. I tried to force a bigger sub window,
    self.app.addLabelSecretEntry("Password")                                        # by making the original large, and then shrinking it 
    self.app.addButtons(["Log In", "Cancel"], [self.logIn, self.cancel])     # before making a subwindow.
    self.app.setFocus("Username")
    self.app.setSize(400,300)                                                                   #<<<<<<< THERE     
    #creating the Database window. the 'mode' parameter determines whether login or signup buttons are used
    self.app.startSubWindow("databaseA", "employee database")
    self.app.setBg("white")
    self.app.addButtons(["Register User", "Log Out", "Close", "test"], [self.registerUser, self.logOut, self.close, self.test])
    self.app.addTable('table1', [['First Name','Last Name','Address', 'Phone Number', 'Job Role', 'Pay Rate']])
    for i in loadUserData():
        print(self.app.getTableRowCount('table1'))
        print(f"adding {i}")
        self.app.addTableRow('table1', i)
        print(f"added {i}")
    self.app.stopSubWindow()

What steps are needed to reproduce the bug


trying to resize a subWindow in any way should be interesting, at least from my perspective I can't find a way to not reproduce the bug

Version Information


for some reason, the code can't read a text file and crashes when I do this -> python myCode.py -v
sry

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

No branches or pull requests

1 participant