ipentry

Documentation for this package can be found at http://tcllib.sourceforge.net/doc/ipentry.html


escargo 25 Jul 2003 - As someone who has spent time testing network devices, I expected a bit more function out of this widget.

For example, I have needed to initialize ethernet addresses and been required to enter three different IP addresses, each with different restrictions:

  1. The netmask for the interface (effectively a string of ones followed by a string of zeroes for a total of 32 bits).
  2. The IP address for the interface (a value that must be consistent with the netmask), which must not end in a zero value or a broadcast address.
  3. The broadcast address for the interface (a value that must be consistent with the netmask and the IP address.

Does this ipentry have a validator mechanism so that values can be checked against other values for consistency?

AF - i think i assumed that kind of validation would be done when the user clicks "ok" instead of actually restricting the input to a valid netmask. i suppose some validation hooks could be added in the style of the entry widget. you could also "prompt" a user by binding to FocusOut on one entry and if its complete inserting the first quads of a bcast addr in another entry and setting the icursor

escargo - The validation hooks would seem to be to be important. The key here is that there are at least two kinds of validation that apply:

  1. Is the value valid in and of itself?
  2. Is the value consistent with other values?

One of the things that's tricky is that inconsistent values need to be allowed, because when you are changing data, you can only change one thing at a time.

Perhaps you could re-use some of the validation/netmask/network address stuff used in A Little CIDR Calculator


well, this is open source - if someone wants to patch the code and turn it in to give more functionality, that's always possible...


Another area to look into is support for the new extended IP addresses.

AF Nov 2008 - the ipentry6 widget has been added


Bryan Oakley March 5, 2007 - the -textvariable option of this widget doesn't work as a normal textvariable. For example, if I have a label associated with the same text variable, that label isn't updated as I change the text in the ipentry.

This is important for the case where you tie the modification of a widget to the state of a button -- when the value changes, I want to enable the "Save" button for instance. I typically do this with a variable trace, but that trace doesn't fire because the variable isn't updated as I type.

AF Nov 2008 - the textvariables now work as expected