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

    Join Date
    Oct 2004
    Posts
    136
    Rep Power
    10

    Tkinter IP Entry?


    Hi to all, I was wondering:
    Is there any way to have a Tkinter text Entry that have 3 dots in it which is like a "IP input" ? where you can only write numbers and not more than 3 numbers between each of the dots?

    Thanks!
    Dag
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    Tkinter does not have a basic widget that validates but you can write your own or use a something like Python Mega Widgets which builds on Tkinter.

    If you are interested in more complex dialogs you should check out Python Mega Widgets Entry Field which implements input validation. You may need to combine 4 Entryfields to get the effect you want.

    If you can use wxPython instead why not have a look at MaskedEditControls or wxValidator.

    grim
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    If what Grim suggested doesn't work out, you could simply use 4 text areas with ... static text's between them.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    51
    Hi!

    If you don't want to use PMW, here is a validating text entry

    Regards, mawe

    Comments on this post

    • Grim Archon agrees : Excellent!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    136
    Rep Power
    10
    Ok thanks... What I wanted most is to have the dots(static/not removable) inside the entry box, not static text between many entry boxes, but I guess maybe wxpython can do this more easy.
    I will take a look a those links and consider it, it's not that important that I have to change to wxpython or something else :-).

    thanks for many replies!
    Dag

IMN logo majestic logo threadwatch logo seochat tools logo