Previous Next Contents

19. Mathoms

This section is a dumping ground for things that don't belong anywhere else (mathom is a Hobbit term: a mathom is something that no one knows what to do with but they don't want to throw it away).

19.1 Enlightening MGv

If you're into the enlightened look, then you should make sure you don't try and specify a backgroundPixmap for the main scrolled window. Resource settings like this:

        MGv*view*backgroundPixmap:              XmUNSPECIFIED_PIXMAP
        MGv*backgroundPixmap:                   /full/path/to/tile.xpm
        MGv*foreground:                         fg
        MGv*background:                         bg
        MGv*XmText.backgroundPixmap:            XmUNSPECIFIED_PIXMAP
        MGv*XmTextField.backgroundPixmap:       XmUNSPECIFIED_PIXMAP
        MGv*XmList.backgroundPixmap:            XmUNSPECIFIED_PIXMAP
should give you the enlightened look (text and list widgets look pretty crappy with background pixmaps so there's no point in even trying). If you try and specify a backgroundPixmap for view, you will probably get an X protocol error at startup. For best results, fg should contrast with the whole tiling pixmap (smooth pixmaps work best) and bg should be a solid color that is close the pixmap colors. Better results can be had if you're willing to set up different pixmaps for the various types of widgets; if you come up with anything really cool, let me know. If you're wondering what this stuff looks like, my homepage has a couple of screen shots.

If you don't have Motif 2.0.1+ then the backgroundPixmap resource might not work (it does work with Netscape 4.X/Linux and that uses Motif 1.2.X). I have tried this stuff with Irix and CDE (Motif 1.2.5) without success: MGv died on Irix and ignored the pixmap under CDE. I think the problem could be fixed by adding a String to Pixmap type converter that understood XPM files but that will have to wait.

19.2 Using MGv With Netscape

If you want to use MGv as the PostScript viewer with Netscape you just have to set the application/postscript MIME handler to "mgv %s". The MIME handlers can be configured in the big Preferences dialog for Netscape 4 or in the Helpers tab of the General Preferences dialog in Netscape 3.

This is the original reason that I changed the saving behavior of MGv (in version one you could only save marked pages, now you can save whatever you want).

19.3 Using MGv With CDE

If you want to use MGv in the CDE desktop, the following article from comp.unix.cde may be of interest:

Article 1968 of comp.unix.cde:
From: Larry Gardner <lkg@atl.hp.com>
Newsgroups: comp.unix.cde
Subject: Re: Registering new file types
Date: Wed, 25 Jun 1997 10:11:39 -0400
Organization: Hewlett Packard TIS/SEM/IES
Lines: 109
Message-ID: <33B1271B.3BC4@atl.hp.com>
References: <5oojdv$823@bioko.ifi.unizh.ch>
NNTP-Posting-Host: wscoe2.atl.hp.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01 (X11; I; HP-UX B.10.00 9000/747)
To: Dimitrios Tombros <tombros@ifi.unizh.ch>
Xref: news.lglobal.com comp.unix.cde:1968

Dimitrios Tombros wrote:
> 
> Is it possible to register new file types with CDE for a specific
> user so that when clicking on these types from the file manager
> the respective application is started?
> 
> Any help will be appreciated; if this is a FAQ then please point me
> to the FAQ location.
> 
> --
> 
> ----------------------------------------------------------------------
> Dimitrios Tombros                   Database Technology Research Group
> e-mail: tombros@ifi.unizh.ch               Computer Science Department
> http://www.ifi.unizh.ch/staff/tombros.html        University of Zurich

Here's an example for the postscript file type that will use ghostscript
and ghostview to print/view postscript files.

HTH

Larry

ghostview.dt

################################################################################
#
# File:         ghostview.dt
# RCS:          $ Header: ghostview.dt,v 1.0 97/06/04 16:39:57 lkg Exp $
# Description:  CDE generic action for application execution.
# Author:       TIS/SEM/IES WS-COE Team.
# Created:      Wed Jun  4 16:39:27 EDT 1997
# Modified:
# Language:     CDE 1.0 Actions
#
################################################################################
#
# Initialize Variables
#
################################################################################

set GHOSTVIEW=/opt/gnu/bin/X11/ghostview

################## END OF VARIABLE INITIALIZATION
##############################

ACTION GhostView
{
    ARG_COUNT   0
    ICON        gv
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING $GHOSTVIEW
    DESCRIPTION Ghostview postscript viewer.
}

ACTION GhostView
{
    ARG_COUNT   *
    ARG_TYPE    POSTSCRIPT
    ICON        gv
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING $GHOSTVIEW %(File)Arg_1%
    DESCRIPTION Ghostview postscript viewer.
}

ACTION gsPrint
{
    TYPE        COMMAND
    WINDOW_TYPE NO_STDIO
    EXEC_STRING sh -c '/opt/gnu/bin/gs -q -sDEVICE=ljet4 -r300 -dNOPAUSE \
                       -sOutputFile=- \
                       %(File)Arg_1"Postscript File To Print:"% \
                       %(File)Args% | lp -s -oraw'
    DESCRIPTION The gsPrint action formats its arguments \
                using the 'gs' command and prints them to \
                the default printer using 'lp'.
}

DATA_ATTRIBUTES POSTSCRIPT
{
    ICON        Dtps
    ACTIONS     Open,Print
    DESCRIPTION This is a postscript file.
}
DATA_CRITERIA POSTSCRIPT1
{
    DATA_ATTRIBUTES_NAME POSTSCRIPT
    MODE                 !d
    NAME_PATTERN         *.[Pp][Ss]
}

ACTION Open
{
    ARG_TYPE    POSTSCRIPT
    TYPE        MAP
    MAP_ACTION  GhostView
    DESCRIPTION This action opens the postscript file type.
}

ACTION Print
{
    ARG_TYPE    POSTSCRIPT
    TYPE        MAP
    MAP_ACTION  gsPrint
    DESCRIPTION This action prints the postscript file type.
}
This would probably work with MGv if you change "ghostview" to "mgv" all over the place. You'll have to make your own icons though (mine/mgv_cicon.xpm would be a good starting place but it is the wrong size). I can't really help you with this (yet) so you're on your own (of course, I'd be interested in any results).

I plan to eventually support the CDE help system in the future (eventually I'll get CDE for my other linux box; when that happens, I'll set up some decent CDE integration).


Previous Next Contents