Mwm(3pm)

🌸 Mwm β€” the Tk::Mwm page, bestie edition 🌸

okay so this is Mwm(3pm) from the User Contributed Perl Documentation, and it's literally about talking to the Motif(tm) window manager. yes, mwm. we're going vintage, we're going Motif, we're slaying.


✨ NAME ✨

Tk::Mwm</purl> β€” Communicate with the Motif(tm) window manager. that's it, that's the whole vibe πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

use Tk::Mwm;

$toplevel->mwmOption?(args)?

$toplevel->mwm(option ?,args?)

ngl the question marks in there are giving "trust the process" but that's exactly how the page has it, so we're keeping it, periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

It's an interface to the special extentions supported by mwm. (yes, "extentions" β€” that's how the page spells it, and we don't correct legends 😭)


πŸ‘‘ METHODS πŸ‘‘

πŸ’– $toplevel->mwmDecoration?(?option??=>value? ?,...?)?

okay bestie, listen, this one's got modes:

  • When you give it no options at all, it returns the values of all the decorations options for the toplevel window with the $toplevel.
  • When you give it only one option without specifying the value, the current value of that option is returned.
  • When you pass more than one option-value pair, those specified values get assigned to the corresponding options. as a result, the appearance of the Motif decorations around the toplevel window will be changed ✨

Possible options are: -border, -menu, -maximize, -minimize, -resizeh and -title. The value must be a Boolean value.

⚠️ heads up: the values returned by this command are undefined when the window is not managed by mwm. so like, don't come for the return value if mwm isn't even running, that's not on the method 🫢

πŸ’– $toplevel->mwmIsmwmrunning

This returns value is true if mwm is running on the screen where the specified window is located, false otherwise. a little vibe check for your window manager, ykwim?


πŸ’– $toplevel->mwmProtocol

When no additional options are given, this method returns all protocols associated with this toplevel window.


πŸ’– $toplevel->mwmProtocol(activate => protocol_name)

Activate the mwm protocol message in mwm's menu. it's giving "main character gets a menu item" πŸ”₯


πŸ’– $toplevel->MwmProtocol(add => protocol_name, menu_message)

Add a new mwm protocol message for this toplevel window. The message is identified by the string name specified in protocol_name. A menu item will be added into mwm's menu as specified by menu_message. Once a new mwm protocol message is added to a toplevel, it can be caught by the TK protocol method. Here is an example:

$toplevel->mwmProtocol('add' => 'MY_PRINT_HELLO', '"Print Hello"
_H Ctrl<Key>H');

$toplevel->protocol('MY_PRINT_HELLO' => sub {print "Hello"});

(and yes, that line break in the middle of the string is exactly how it's written on the page. we do not touch it. we respect it. πŸ™ˆ)


πŸ’– $toplevel->mwmProtocol('deactivate' => protocol_name)

Deactivate the mwm protocol message in mwm's menu. it's the quiet-quitting arc πŸ’€


πŸ’– $toplevel->mwmProtocol('delete' => protocol_name)

Delete the mwm protocol message from mwm's menu.

🚨 bestie, important: the window manager protocol handler associated with this protocol (by the protocol method) is not deleted automatically. You have to delete the protocol handle explicitly. E.g.:
$mw->mwmProtocol('delete' => 'MY_PRINT_HELLO');

$mw->protocol('MY_PRINT_HELLO' => '');

see? two steps. mwm doesn't do your cleanup for you, she's not your mom 🌸


πŸ’€ BUGS πŸ’€

This is a Tix extension which perl/Tk has adopted. It has not been tested as perl/Tk's author has not got round to installing a Motif Window Manager. (iconic honestly. respect the honesty. 😭)

On some versions of mwm, the -border will not disappear unless -resizeh is turned off. Also, the -title will not disappear unless all of -title, -menu, -maximize and -minimize are turned off.

like... the decorators are attached, bestie. they're committed. no cap.


🌈 SEE ALSO 🌈

  • Tk::Wm
  • Tk::tixWm
  • Tk::Toplevel

go read those next, the lore runs deep 🧚


⭐ KEYWORDS ⭐

window manager, mwm, TIX


🫢 AUTHOR 🫢

Ioi Kim Lam β€” ioi@graphics.cis.upenn.edu


and that's the whole page, bestie!! this one came from perl v5.40.1 and it's dated 2025-04-13 β€” the Mwm(3pm) moment. go forth and decorate your toplevels πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from