Subject: Patch: implement FVWM::Module::Tk::showMessage

From: Scott Smedley <[email-masked]>
Date: Sat, 14 Jun 2003 00:03:12 +1000

? perllib/FVWM/Module/.Tk.pm.swp
Index: perllib/FVWM/Module/Tk.pm
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/Module/Tk.pm,v
retrieving revision 1.9
diff -u -r1.9 Tk.pm
--- perllib/FVWM/Module/Tk.pm	10 Jun 2003 00:00:17 -0000	1.9
+++ perllib/FVWM/Module/Tk.pm	13 Jun 2003 14:01:36 -0000
@@ -75,6 +75,18 @@
 	$self->send("All ('$title') Close") if $btn eq 'Close All Errors';
 }
 
+sub showMessage ($$;$)
+{
+	my $self = shift;
+	my $msg = shift;
+	my $title = shift || ($self->name . " Message");
+
+	$self->topLevel()->messageBox(-icon => 'info',
+			-type => 'ok',
+			-title => $title,
+			-message => $msg);
+}
+
 sub topLevel ($) {
 	return shift->{topLevel};
 }
@@ -108,8 +120,8 @@
 =head1 DESCRIPTION
 
 The B<FVWM::Module::Tk> package is a sub-class of B<FVWM::Module> that
-overloads the methods B<new>, B<eventLoop> and B<showError> to manage
-Tk objects as well. It also adds new methods B<topLevel> and B<winId>.
+overloads the methods B<new>, B<eventLoop>, B<showMessage> and B<showError>
+to manage Tk objects as well. It also adds new methods B<topLevel> and B<winId>.
 
 This manual page details only those differences. For details on the
 API itself, see L<FVWM::Module>.
@@ -146,6 +158,10 @@
 "Exit Module" terminates your entire module.
 
 Good for diagnostics of a Tk based module.
+
+=item B<showMessage> I<msg> [I<title>]
+
+Creates a message window with one "Ok" button.
 
 =item B<topLevel>

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 13 Jun 2003 22:48:55 +0000

> +	$self->topLevel()->messageBox(-icon => 'info',

Ok, can you implement showDebug for Tk too?

As the first implementer you may do whatever is useful for you, for
example the dialog may include an option to redirect the debug to file or
stderr or just do what GTK+ does.

If you want your patches to be included without changes, use Tabs like
you do, but make sure it looks structured with any Tab width, like 3 or
20, and surely not just 4.

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]