ipentry(3tk)

πŸ“¦
version 0.9 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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