Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | |
2 | =head1 NAME | |
3 | ||
4 | Tk::Mwm - Communicate with the Motif(tm) window manager. | |
5 | ||
6 | =for category Tix Extensions | |
7 | ||
8 | =head1 SYNOPSIS | |
9 | ||
10 | S< >B<use Tk::Mwm;> | |
11 | ||
12 | S< >I<$toplevel>-E<gt>B<mwm>I<Option>?(I<args>)? | |
13 | ||
14 | S< >I<$toplevel>-E<gt>B<mwm>(I<option> ?,I<args>?) | |
15 | ||
16 | =head1 DESCRIPTION | |
17 | ||
18 | Interface to special extentions supported by mwm. | |
19 | ||
20 | =head1 METHODS | |
21 | ||
22 | =over 4 | |
23 | ||
24 | =item I<$toplevel>-E<gt>B<mwmDecoration>?(?option??=E<gt>value? ?,...?)? | |
25 | ||
26 | When no options are given, this method returns the values of all the | |
27 | decorations options for the toplevel window with the I<$toplevel>. | |
28 | When only one option is given without specifying the value, the | |
29 | current value of that option is returned. | |
30 | When more than one "option-value" pairs are passed to this method, | |
31 | the specified values will be assigned to the corresponding options. As | |
32 | a result, the appearance of the Motif decorations around the toplevel | |
33 | window will be changed. | |
34 | Possible options are: B<-border>, B<-menu>, B<-maximize>, | |
35 | B<-minimize>, B<-resizeh> and B<-title>. The value must be a | |
36 | Boolean value. The values returned by this command are undefined when | |
37 | the window is not managed by mwm. | |
38 | ||
39 | =item I<$toplevel>-E<gt>B<mwmIsmwmrunning> | |
40 | ||
41 | This returns value is true if mwm is running on the screen where the specified | |
42 | window is located, false otherwise. | |
43 | ||
44 | =item I<$toplevel>-E<gt>B<mwmProtocol> | |
45 | ||
46 | When no additional options are given, this method returns all | |
47 | protocols associated with this toplevel window. | |
48 | ||
49 | =item I<$toplevel>-E<gt>B<mwmProtocol>(B<activate> =E<gt> I<protocol_name>) | |
50 | ||
51 | Activate the mwm protocol message in mwm's menu. | |
52 | ||
53 | =item I<$toplevel>-E<gt>B<MwmProtocol>(B<add> =E<gt> I<protocol_name>, I<menu_message>) | |
54 | ||
55 | Add a new mwm protocol message for this toplevel window. The | |
56 | message is identified by the string name specified in | |
57 | I<protocol_name>. A menu item will be added into mwm's menu as | |
58 | specified by I<menu_message>. Once a new mwm protocol message is | |
59 | added to a toplevel, it can be caught by the TK B<protocol> | |
60 | method. Here is an example: | |
61 | ||
62 | S< >I<$toplevel>-E<gt>B<mwmProtocol>(B<'add'> =E<gt> 'MY_PRINT_HELLO', '"Print Hello" _H CtrlE<lt>KeyE<gt>H'); | |
63 | ||
64 | S< >I<$toplevel>-E<gt>B<protocol>(B<'MY_PRINT_HELLO'> =E<gt> sub {print "Hello"}); | |
65 | ||
66 | =item I<$toplevel>-E<gt>B<mwmProtocol>(B<'deactivate'> =E<gt> I<protocol_name>) | |
67 | ||
68 | Deactivate the mwm protocol message in mwm's menu. | |
69 | ||
70 | =item I<$toplevel>-E<gt>B<mwmProtocol>(B<'delete'> =E<gt> I<protocol_name>) | |
71 | ||
72 | Delete the mwm protocol message from mwm's menu. Please note that the | |
73 | window manager protocol handler associated with this protocol (by the | |
74 | B<protocol> method) is not deleted automatically. You have to | |
75 | delete the protocol handle explicitly. E.g.: | |
76 | ||
77 | S< >I<$mw>-E<gt>B<mwmProtocol>(B<'delete'> =E<gt> 'MY_PRINT_HELLO'); | |
78 | ||
79 | S< >I<$mw>-E<gt>B<protocol>(B<'MY_PRINT_HELLO'> =E<gt> ''); | |
80 | ||
81 | =back | |
82 | ||
83 | =head1 BUGS | |
84 | ||
85 | This is a Tix extension which perl/Tk has adopted. It has not been | |
86 | tested as perl/Tk's author has not got round to installing a Motif Window | |
87 | Manager. | |
88 | ||
89 | On some versions of mwm, the B<-border> will not disappear unless | |
90 | B<-resizeh> is turned off. Also, the B<-title> will not disappear | |
91 | unless all of B<-title>, B<-menu>, B<-maximize> and | |
92 | B<-minimize> are turned off. | |
93 | ||
94 | =head1 SEE ALSO | |
95 | ||
96 | L<Tk::Wm|Tk::Wm> | |
97 | L<Tk::tixWm|Tk::tixWm> | |
98 | L<Tk::Toplevel|Tk::Toplevel> | |
99 | ||
100 | =head1 KEYWORDS | |
101 | ||
102 | window manager, mwm, TIX | |
103 | ||
104 | =head1 AUTHOR | |
105 | ||
106 | Ioi Kim Lam - ioi@graphics.cis.upenn.edu | |
107 | ||
108 | =cut | |
109 |