ipentry(3tk)
π ipentry β the IP address entry widget π
okay bestie, so we're doing ipentry, from the ipentry manual page in section 3tk. it's giving "little Tk widget that lets a human type an IP address without it being a whole situation". no cap. let's get into it π«Ά
β¨ SYNOPSIS β¨
package require Tcl 8.4
package require Tk 8.4
package require ipentry ?0.3.2?
::ipentry::ipentry pathName ?option value...?
::ipentry::ipentry6 pathName ?option value...?
pathName complete
pathName get
pathName insert iplist
pathName icursor index
pathName configure option value...
pathName cget option
like, it literally needs Tcl 8.4 and Tk 8.4 minimum, and the package itself is ipentry, version 0.3.2 (or thereabouts, hence the ? β it's optional-ish, the way package require do). πΈ
π DESCRIPTION π
this package hands you a widget for the entering of a IP address. that's it. that's the whole job. and honestly? it ate. π
::ipentry::ipentry pathName ?option value...?
makes a brand new IPv4 ipentry widget and configures it with the options and their values you pass in. slay.
::ipentry::ipentry6 pathName ?option value...?
makes a new ipentry widget for typing in an IPv6 address instead. all the options are exactly the same as the IPv4 widget, no notes, no extra drama. β¨
every widget you make with those commands above comes with these methods, and yes you should know them:
pathName complete
returns a boolean value, bestie. True means the entry contains a complete IP address β as in, all fields have a value. but heads up π: in some cases IPv6 address are valid when fields are missing. you will need to do your own validation to detect this. it's not gonna do that part for you, sorry not sorry.
pathName get
returns the contents of the entry as a list consisting of 4 or 8 elements. π
pathName insert iplist
IPv4 takes a list of 4 elements and inserts one into each quad of the entry, in order. all values in the list must be empty or integers. values outside the range 0 to 255 are modified to be within the range. (so like, it'll fix your nonsense, but do not test it.)
IPv6 takes a list of 8 elements and inserts one into each quad of the entry, in order. all values in the list must be empty or 1 to 4 hex digits. β
pathName icursor index
sets the position of the widgets insertion cursor. only integer values between 0 and 15 are valid for ipentry and 0 to 31 for ipentry6. and here's the catch π₯: setting the icursor will only have an effect if the widget already has the input focus. no focus, no cursor, no vibe.
pathName configure option value...
modifies the configuration of the widget. for options and their meaning see the widget options section. π
pathName cget option
returns information about the current configuration of the widget, for the specified option. for options and their meaning see the widget options section. π¦
π WIDGET OPTIONS π
each option is listed with its Command-Line Switch, its Database Name, and its Database Class, because Tk is extra like that.
-textvariableβ Command-Line Switch:-textvariable; Database Name:textvariable; Database Class:Variable
the name of a variable which holds the value of the IP address. the value must be a string of the form NNN.NNN.NNN.NNN for IPv4 or HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH:HHHH for IPv6 where H is a hex digit. and lowkey important: the variable will be modified to represent a valid IP address if it is not already. it will fix it. on its own. periodt. π
-stateβ Command-Line Switch:-state; Database Name:state; Database Class:State
specifies one of three states for the entry: normal, disabled, or readonly. that's the whole menu, there's no secret fourth one.
-fontβ Command-Line Switch:-font; Database Name:font; Database Class:Font-bdβ Command-Line Switch:-bd; Database Name:borderWidth; Database Class:BorderWidth-fgβ Command-Line Switch:-fg; Database Name:foreground; Database Class:Foreground-bgβ Command-Line Switch:-bg; Database Name:background; Database Class:Background-reliefβ Command-Line Switch:-relief; Database Name:relief; Database Class:Relief-highlightthicknessβ Command-Line Switch:-highlightthickness; Database Name:highlightThickness; Database Class:HighlightThickness-highlightcolorβ Command-Line Switch:-highlightcolor; Database Name:highlightColor; Database Class:HighlightColor-highlightbackgroundβ Command-Line Switch:-highlightbackground; Database Name:highlightBackground; Database Class:HighlightBackground-selectbackgroundβ Command-Line Switch:-selectbackground; Database Name:selectBackground; Database Class:Background-selectforegroundβ Command-Line Switch:-selectforeground; Database Name:selectForeground; Database Class:Foreground-selectborderwidthβ Command-Line Switch:-selectborderwidth; Database Name:selectBorderWidth; Database Class:BorderWidth-disabledbackgroundβ Command-Line Switch:-disabledbackground; Database Name:disabledBackground; Database Class:DisabledBackground-disabledforegroundβ Command-Line Switch:-disabledforeground; Database Name:disabledForeground; Database Class:DisabledForeground-readonlybackgroundβ Command-Line Switch:-readonlybackground; Database Name:readonlyBackground; Database Class:ReadonlyBackground-insertbackgroundβ Command-Line Switch:-insertbackground; Database Name:insertBackground; Database Class:Background
β¨ psst: these last ones are standard widget options. see options for a description of their meanings and values. iykyk.
π BUGS, IDEAS, FEEDBACK π
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. not me being honest about it π β please report such in the category ipentry of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. please also report any ideas for enhancements you may have for either package and/or documentation. they actually want to hear it, fr fr. π«Ά
π KEYWORDS π
entry, ip address, network
π CATEGORY π
Widget
that's the whole page bestie!! this is from tklib 0.3.2, dated ipentry(3tk), and it's giving iconic. go forth and enter some IP addresses responsibly πβ¨π
π¦ where this page comes from
- debian trixie: tklib 0.9-1
- ubuntu questing: tklib 0.9-1
- ubuntu resolute: tklib 0.9-1build1
- ubuntu stonking: tklib 0.9-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms