emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xpert]Default fonts for menus, dialogues, etc


From: pcpa
Subject: Re: [Xpert]Default fonts for menus, dialogues, etc
Date: Mon, 03 Dec 2001 00:10:43 -0200 (BRDT)
User-agent: IMP/PHP IMAP webmail program 2.2.7

Cópia Richard Stallman <address@hidden>:

  Hi,

> Emacs lets the user customize the colors used by menus by customizing
> a special face.  When the user sets the "inverse video" flag in that
> face, for Emacs to do the right thing it must be able to determine
> what colors would be used by default.  It can check for resources to
> specify them, but what if there are no resources--what colors would be
> used then?

  Xaw uses the resources XtDefaultBackground and XtDefaultForeground, that
are actually the value of WhitePixelOfScreen and BlackPixelOfScreen, or the
inverse if the resource reverseVideo is set.

  Unfortunately the values of {Black,White}Pixel of screen can only be set
when running at 1bpp, but not all XFree86 drivers support 1bpp, and not all
of them will use the XF86Config options to set these values.

> One suggestion was that Emacs should define fallback resources to
> specify the foreground and background colors.  That does enable Emacs
> to determine, always, what colors are to be used.  But is this proper
> behavior for an application?  It could mean an inconsistency between
> Emacs and other applications in regard to how they display menus.  Is
> that a real issue?

  I believe shipping a /usr/X11R6/lib/X11/app-defaults/Emacs file for
specifying default resources would be a better idea, but fallback resources
aren't completely a bad solution, better yet if it's value is programable,
and the user knows it is a fallback resource. For example, in the xedit
lisp interpreter I am working on, one can say:

(require "xt")

(setq main-shell
    (xt-app-initialize 'app-context "MyApp" '(("title" . "MyTitle"))
        '("*Background: some-color" "*Foreground: some-other-color")))

  That will set main-shell to a "handle" for the shell widget and will at
the same step create a new global variable (or change the value of the
lexically binded variable) app-context to a "handle" for an XtAppContext
implicitly created by the function.

  The prototype is:
xt-app-initialize app-context-return application-class &optional options
fallback-resources

  But it is still subject to changes (probably for handling command line
parameters), as there is not yet a formal release of the xedit lisp
interpreter. The adavantage of using the fallback-resources argument is that
the code becomes completely self-contained, no need for an external
configuration file.

> Is there some rule that says what the default menu colors should be
> when there are no resource to specify them?  Or is each toolkit
> ideosyncratic in that regard?  Currently Emacs supports the Athena
> widgets and LessTif/Motif.

  I believe there is no rule for this, but every toolkit has some way to
determine how it will look if no configuration was made, in the case of
Athena, it will be a simple rectangular window with white-color background,
black-color foreground, and 1 pixel black-color border.

> _______________________________________________
> Xpert mailing list
> address@hidden
> http://XFree86.Org/mailman/listinfo/xpert

Paulo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]