chatwidget(3tk)
π¬ chatwidget(3tk) β the composite widget for chat apps
bestie, welcome to the manual page for chatwidget from tklib, version 1.1.4 π«Ά
No cap: this is a composite widget for chat applications. That's literally its whole tagline. It's giving "I built you a whole chat room layout so you don't have to". π
β¨ NAME β¨
chatwidget β provides a multi-paned view suitable for display of chat room or irc channel information. π
β¨ SYNOPSIS β¨
package require Tk 8.5
package require chatwidget ?1.1.4?
::chatwidget::chatwidget path ?options?
$widget topic command args
$widget name nick args
$widget message text args
$widget hook command args
$widget names args
$widget entry args
$widget chat args
Heads up: that'spackage require Tk 8.5β Tk 8.5 is the vibe floor, bestie. And the version is optional, hence the?1.1.4?with the lil question marks. β¨
β¨ DESCRIPTION β¨
okay so. This is a composite widget designed to simplify the construction of chat applications. It's not out here doing one job, it's doing the whole ensemble cast. π
The widget contains:
- display areas for chat messages π¬
- display areas for user names π
- display areas for topic π
- and an entry area βοΈ
It automatically handles colourization of messages per nick and manages nick completion β yes, tab-completing usernames, she does that. π§
There's also a system of hooks that permit the application author to adjust display features. So if you're the one building the app, you get to customize the whole look. The main chat display area may be split for use displaying history or for searching. π₯
The widget is made up of a number of text widget and panedwindow widgets so that the size of each part of the display may be adjusted by the user. Fr fr, your users can drag the dividers around and resize everything. All the text widgets may be accessed via widget passthrough commands if fine adjustment is required. The topic and names sections can also be hidden if desired. π
β¨ COMMANDS β¨
πΈ ::chatwidget::chatwidget path ?options?
Create a new chatwidget using the Tk window id path. Any options provided are currently passed directly to the main chat text widget. So like, whatever you pass in, goes straight to the chat text widget. iykyk. β¨
β¨ WIDGET COMMANDS β¨
π $widget topic command args
The chat widget can display a topic string, for instance the topic or name given to a multi-user chatroom or irc channel. π
showβ enable display of the topic. β¨hideβ disable display of the topic. πsettopic β set the topic text to topic. π
π $widget name nick args
Control the names and tags associated with names. π
list ?-full?β returns a list of all the user names from the names view. If?-full?is given then the list returned is a list of lists where each sublist is made up of the nick followed by any options that have been set on this nick entry. This may be used to examine any application specific options that may be applied to a nick when using theaddcommand. πaddnick?options?deletenick
π $widget message text args
Add messages to the display. options are -nick, -time, -type, -mark -tags π¬
noting this exactly as written: that's-markand-tagsβ two separate flags, right there in the original, bestie. Don't merge them, don't rename them. π«Ά
π $widget hook command args
Manage hooks. add (message, post names_group, names_nick, chatstate), remove, run πͺ
π $widget names args
Passthrough to the name display text widget. See the text widget manual for all available commands. The chatwidget provides two additional commands show and hide which are used to control the display of this element in the widget. π
π $widget entry args
Passthrough to the entry text widget. See the text widget manual for all available commands. βοΈ
π $widget chat args
Passthrough to the chat text widget. See the text widget manual for all available commands. π¬
β¨ EXAMPLE β¨
okay bestie here's a whole working demo, periodt:
chatwidget::chatwidget .chat
proc speak {w msg} {$w message $msg -nick user}
.chat hook add post [list speak .chat]
pack .chat -side top -fill both -expand 1
.chat topic show
.chat topic set "Chat widget demo"
.chat name add "admin" -group admin
.chat name add "user" -group users -color tomato
.chat message "Chatwidget ready" -type system
.chat message "Hello, user" -nick admin
.chat message "Hello, admin" -nick user
A more extensive example is available by examining the code for the picoirc program in the tclapps repository which ties the tcllib picoirc package to this chatwidget package to create a simple irc client. π₯π
β¨ BUGS, IDEAS, FEEDBACK β¨
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. π That's just how it is. Please report such in the category chatwidget of the Tklib Trackers [http://core.tcl.tk/tklib/reportlist]. And please also report any ideas for enhancements you may have for either package and/or documentation. The maintainers genuinely want your thoughts, bestie. π«Ά
β¨ SEE ALSO β¨
text(3tk)π
β¨ KEYWORDS β¨
chat, chatwidget, composite widget, irc, mega-widget, widget πβ¨
and that's the whole page!! π This little love letter came from tklib, version 1.1.4, and the page itself is chatwidget(3tk). slay, go build a chat app, you've got this. ππ¦πΈ
π¦ 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