Validators and wxPython

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Extremist
    New Member
    • Jan 2007
    • 94

    #1

    Validators and wxPython

    Hi there,
    I have a little problem. If I put a validator in a wxTextCtrl, If you enter text, the background color changes to an awful grey color, what can I do for this not to happen?
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by Extremist
    Hi there,
    I have a little problem. If I put a validator in a wxTextCtrl, If you enter text, the background color changes to an awful grey color, what can I do for this not to happen?
    Have you explicitly set the default style for the wxTextCtrl?

    Comment

    • Extremist
      New Member
      • Jan 2007
      • 94

      #3
      Originally posted by Motoma
      Have you explicitly set the default style for the wxTextCtrl?
      No
      If you say
      Code:
       
      txtctrl = wx.TextCtrl(self,
                  -1,"", name = "atext" 
                  validator = Validator.Validator(Validator.s+ Validator.o, maxcount=4))
      txtctrl.SetBackgroundColour(wx.WHITE)
      then it still does that, am I missing something?

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by Extremist
        Hi there,
        I have a little problem. If I put a validator in a wxTextCtrl, If you enter text, the background color changes to an awful grey color, what can I do for this not to happen?
        I haven't played with validators yet, but have a need to do so soon. Is this your fedora or windows install? Is there a difference?

        Comment

        • Extremist
          New Member
          • Jan 2007
          • 94

          #5
          Originally posted by bartonc
          I haven't played with validators yet, but have a need to do so soon. Is this your fedora or windows install? Is there a difference?
          It is in Fedora,
          I haven't had much experience in Windows with Validators.
          It is really annoying, it gives the impression that it is disabled.
          This problem may sound stupid, but a lot of not-so-smart people may need to see the app, and then they get confused

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            Originally posted by Extremist
            It is in Fedora,
            I haven't had much experience in Windows with Validators.
            It is really annoying, it gives the impression that it is disabled.
            This problem may sound stupid, but a lot of not-so-smart people may need to see the app, and then they get confused
            I think that the easiest way to track down things like this is to make a simpleApp with just enough stuff in it to reproduce your problem. That way you can post it here and I can run it under windows or you can take it to your other machine by any convenient means in order to compare the two installations. I have seen that many times, in making the simpleApp, you will discover something in the larger app that is causing the odd behaviour. Or you will find that this situation arises from version/installation problems. I highly recommend that you make sure you are using current versions of wx (2.8.0 minimum).

            Comment

            Working...