Mwm(3) User Contributed Perl Documentation Mwm(3)

# [NAME](#NAME)

Tk::Mwm - Communicate with the Motif(tm) window manager.

# [SYNOPSIS](#SYNOPSIS)

    **use Tk::Mwm;**

    *$toplevel*-&gt;**mwmOption**?(*args*)?

    *$toplevel*-&gt;**mwm**(*option* ?,*args*?)

# [DESCRIPTION](#DESCRIPTION)

Interface to special extentions supported by mwm.

# [METHODS](#METHODS)

*$toplevel*-&gt;**mwmDecoration**?(?option??=&gt;value? ?,...?)?

When no options are given, this method returns the values of all the decorations options for the toplevel window with the *$toplevel*. When only one option is given without specifying the value, the current value of that option is returned. When more than one "option-value" pairs are passed to this method, the specified values will be 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. The values returned by this command are undefined when the window is not managed by mwm.

*$toplevel*-&gt;**mwmIsmwmrunning**

This returns value is true if mwm is running on the screen where the specified window is located, false otherwise.

*$toplevel*-&gt;**mwmProtocol**

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

*$toplevel*-&gt;**mwmProtocol**(**activate** =&gt; *protocol\_name*)

Activate the mwm protocol message in mwm's menu.

*$toplevel*-&gt;**MwmProtocol**(**add** =&gt; *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*-&gt;**mwmProtocol**(**'add'** =&gt; 'MY\_PRINT\_HELLO', '"Print Hello" \_H Ctrl&lt;Key&gt;H');

    *$toplevel*-&gt;**protocol**(**'MY\_PRINT\_HELLO'** =&gt; sub {print "Hello"});

*$toplevel*-&gt;**mwmProtocol**(**'deactivate'** =&gt; *protocol\_name*)

Deactivate the mwm protocol message in mwm's menu.

*$toplevel*-&gt;**mwmProtocol**(**'delete'** =&gt; *protocol\_name*)

Delete the mwm protocol message from mwm's menu. Please note that 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*-&gt;**mwmProtocol**(**'delete'** =&gt; 'MY\_PRINT\_HELLO');

    *$mw*-&gt;**protocol**(**'MY\_PRINT\_HELLO'** =&gt; '');

# [BUGS](#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.

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.

# [SEE ALSO](#SEE_ALSO)

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

# [KEYWORDS](#KEYWORDS)

window manager, mwm, TIX

# [AUTHOR](#AUTHOR)

Ioi Kim Lam - ioi@graphics.cis.upenn.edu

2026-08-31 perl v5.44.0

---

Document: Tk::Mwm(3pm) from perl-tk 804.036-r11 (Chainguard OS)
Source: https://github.com/eserte/perl-tk
