#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    18
    Rep Power
    0

    Curly Braces around text


    Code:
    RegErrorWin = GraphWin("Registration Error!",400,175)
            NoOfErrorsTextLabel = "There are",NoOfErrors,"errors:"
            NoOfErrorsText = Text(Point(68,15),NoOfErrorsTextLabel)
            NoOfErrorsText.draw(RegErrorWin)
    Currently I'm getting curly braces around the text when it's printed on the screen. I've no idea why it's doing this, I've googled it, and had no such luck. Only with TKinter problems. I'm using the graphics module.

    And while I've got this thread going, I'm having another problem, that once the user clicks on a window, it disables them from clicking again, which can happen by mistake, but can be frustrating, I'm not sure how to fix it.

    It's this whole function here:

    Code:
    def RegisterScreen():
        RegisterWin = GraphWin("Register",300,150)
        UsernameRegLabel = Text(Point(45,25),"Username: ")
        UsernameRegLabel.draw(RegisterWin)
        UsernameRegText = Entry(Point(175,25),20)
        UsernameRegText.draw(RegisterWin)
        PasswordRegLabel = Text(Point(45,50),"Password: ")
        PasswordRegLabel.draw(RegisterWin)
        PasswordRegText = Entry(Point(175,50),20)
        PasswordRegText.draw(RegisterWin)
        PasswordConfRegLabel = Text(Point(52,75),"Confirm: ")
        PasswordConfRegLabel.draw(RegisterWin)
        PasswordConfRegText = Entry(Point(175,75),20)
        PasswordConfRegText.draw(RegisterWin)
        EmailRegLabel = Text(Point(60,100),"Email: ")
        EmailRegLabel.draw(RegisterWin)
        EmailRegText = Entry(Point(175,100),20)
        EmailRegText.draw(RegisterWin)
        SubmitButton = Rectangle(Point(195,115),Point(265,140))
        SubmitButton.draw(RegisterWin)
        SubmitButtonText = Text(Point(230,128),"Submit")
        SubmitButtonText.draw(RegisterWin)
        CloseButton = Rectangle(Point(115,115),Point(185,140))
        CloseButton.draw(RegisterWin)
        CloseButtonText = Text(Point(150,128),"Close")
        CloseButtonText.draw(RegisterWin)
    
        MouseRegWin = RegisterWin.getMouse()
        RegWinX = MouseRegWin.getX()
        RegWinY = MouseRegWin.getY()
    
        if RegWinX>=195 and RegWinX<=265:
            if RegWinY>=115 and RegWinY<=140:
                global RegisterData
                
                RegisterData = []
    
                Username = UsernameRegText.getText()
                Password = PasswordRegText.getText()
                PasswordConf = PasswordConfRegText.getText()
                Email = EmailRegText.getText()
    
                RegisterData.append(Username)
                RegisterData.append(Password)
                RegisterData.append(PasswordConf)
                RegisterData.append(Email)
                
                ProcessRegistration()
                
        elif RegWinX>=115 and RegWinX<=185:
            if RegWinY>=115 and RegWinY<=140:
                RegisterWin.close()
    It's mainly the bottom bit:

    Code:
    if RegWinX>=195 and RegWinX<=265:
            if RegWinY>=115 and RegWinY<=140:
                global RegisterData
                
                RegisterData = []
    
                Username = UsernameRegText.getText()
                Password = PasswordRegText.getText()
                PasswordConf = PasswordConfRegText.getText()
                Email = EmailRegText.getText()
    
                RegisterData.append(Username)
                RegisterData.append(Password)
                RegisterData.append(PasswordConf)
                RegisterData.append(Email)
                
                ProcessRegistration()
                
        elif RegWinX>=115 and RegWinX<=185:
            if RegWinY>=115 and RegWinY<=140:
                RegisterWin.close()
    Thanks for reading.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    Needs someone willing to investigate the graphics module and what looks like an incomplete code listing.

    Noskiw: Please post a small working program that exhibits the problem.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo