all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gtk Emacs: how specify menu font?
@ 2003-03-18 14:34 Robert J. Chassell
  2003-03-18 22:21 ` Jan D.
  0 siblings, 1 reply; 5+ messages in thread
From: Robert J. Chassell @ 2003-03-18 14:34 UTC (permalink / raw)


Using GNU Emacs  built with --with-x-toolkit=gtk
how do I specify the font for the menu?

    GNOME 1.4, BrushedMetalClean theme, 

    Today's Debian testing,         Tue, 2003 Mar 18  14:14 UTC 
    Today's GNU Emacs CVS snapshot, Tue, 2003 Mar 18  13:24 UTC
    GNU Emacs 21.3.50.222 (i686-pc-linux-gnu)

In my .emacs file, I specify

  (font . "10x20")    # high resolution screen

and 

 '(menu ((t (:background "DodgerBlue4" :foreground "green"  :family "times"))))

This works fine with the LUCID toolkit, but has no effect in the gtk
toolkit.

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtk Emacs: how specify menu font?
  2003-03-18 14:34 gtk Emacs: how specify menu font? Robert J. Chassell
@ 2003-03-18 22:21 ` Jan D.
  2003-03-20 21:46   ` Robert J. Chassell
  0 siblings, 1 reply; 5+ messages in thread
From: Jan D. @ 2003-03-18 22:21 UTC (permalink / raw)
  Cc: emacs-devel

> Using GNU Emacs  built with --with-x-toolkit=gtk
> how do I specify the font for the menu?
> 
>     GNOME 1.4, BrushedMetalClean theme, 
> 
>     Today's Debian testing,         Tue, 2003 Mar 18  14:14 UTC 
>     Today's GNU Emacs CVS snapshot, Tue, 2003 Mar 18  13:24 UTC
>     GNU Emacs 21.3.50.222 (i686-pc-linux-gnu)
> 
> In my .emacs file, I specify
> 
>   (font . "10x20")    # high resolution screen
> 
> and 
> 
>  '(menu ((t (:background "DodgerBlue4" :foreground "green"  :family "times"))))
> 
> This works fine with the LUCID toolkit, but has no effect in the gtk
> toolkit.

It is because this updates the X resource database.  Xt based toolkits
like Lucid, picks these up.  GTK does not use the X resource database
(a design error IMHO), but has its own syntax, names and files for
customizations as this.  Please see the Emacs manual, X Resources ->
GTK resources for ways of doing this.

	Jan D.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtk Emacs: how specify menu font?
  2003-03-18 22:21 ` Jan D.
@ 2003-03-20 21:46   ` Robert J. Chassell
  2003-03-21 14:23     ` Jan D.
  0 siblings, 1 reply; 5+ messages in thread
From: Robert J. Chassell @ 2003-03-20 21:46 UTC (permalink / raw)
  Cc: emacs-devel

How do I specify a background color for both the menubar and the sub
menus?

    GNOME 1.4, BrushedMetalClean theme

    Today's Debian testing,         2003 Mar 20
    Today's GNU Emacs CVS snapshot, Thu, 2003 Mar 20  20:18 UTC
    GNU Emacs 21.3.50.235 (i686-pc-linux-gnu)
        configured with --with-x-toolkit=gtk

You wrote:

   It is because this updates the X resource database.  ... Please see
   the Emacs manual, X Resources -> GTK resources for ways of doing
   this.

Thank you!  I have done that and am writing this message in an Emacs
configured with --with-x-toolkit=gtk in a window that looks OK,
although it is not what I set out to create.

(Incidentally, this instance of Emacs does not flicker, which you
suggested might be due to my having some older libraries.)

It turns out that in my ~/.gtkrc file I could specify a background for
the menubar, but not for the sub menus.

The "green" font color for the menubar was hard to read in the sub
menus, so I ended up commenting out the bg for the menubar.

Here is the ~/.gtkrc file after some experimenting (by the way, I
linked it to ~/.gtkrc-2.0, although that does not seem to matter):

    style "menufont"
     {
       font_name = "times 20"

       fg[NORMAL] = "green4"
       fg[SELECTED] = "green3"
       fg[ACTIVE] = "green2"
       fg[PRELIGHT] = "green1"
     }

    widget "*menu*" style "menufont"


Note that no background is set; when it is set, it only effects the
menubar, not the sub menus.

Strangely enough, the following produces exactly the same results --
none of the `bg', background, colors have any effect on either the
menubar or the submenus, even though they are not commented out!

    style "itemfont"
     {
       font_name = "times 20"

       bg[NORMAL] = "DodgerBlue4"
       bg[ACTIVE] = "DodgerBlue3"
       bg[PRELIGHT] = "DodgerBlue2"

       fg[NORMAL] = "green4"
       fg[SELECTED] = "green3"
       fg[ACTIVE] = "green2"
       fg[PRELIGHT] = "green1"
     }

    widget "*item*" style "itemfont"


What should I do to create a "DodgerBlue4" background for *both* the
menubar and its submenus?  (Then I will use "green", not "green4" for
fg[NORMAL]; that is what the Lucid toolkit permits me to do.)

--
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtk Emacs: how specify menu font?
  2003-03-20 21:46   ` Robert J. Chassell
@ 2003-03-21 14:23     ` Jan D.
  2003-03-21 15:25       ` Robert J. Chassell
  0 siblings, 1 reply; 5+ messages in thread
From: Jan D. @ 2003-03-21 14:23 UTC (permalink / raw)
  Cc: emacs-devel

Robert J. Chassell wrote:
> How do I specify a background color for both the menubar and the sub
> menus?

...

> Strangely enough, the following produces exactly the same results --
> none of the `bg', background, colors have any effect on either the
> menubar or the submenus, even though they are not commented out!
> 
>     style "itemfont"
>      {
>        font_name = "times 20"
> 
>        bg[NORMAL] = "DodgerBlue4"
>        bg[ACTIVE] = "DodgerBlue3"
>        bg[PRELIGHT] = "DodgerBlue2"
> 
>        fg[NORMAL] = "green4"
>        fg[SELECTED] = "green3"
>        fg[ACTIVE] = "green2"
>        fg[PRELIGHT] = "green1"
>      }
> 
>     widget "*item*" style "itemfont"
> 
> 
> What should I do to create a "DodgerBlue4" background for *both* the
> menubar and its submenus?  (Then I will use "green", not "green4" for
> fg[NORMAL]; that is what the Lucid toolkit permits me to do.)

I can not understand how the naming for menus and dialogs work.  I filed a bug 
about it once, but it won't be fixed in GTK, see 
http://bugzilla.gnome.org/show_bug.cgi?id=101987.

In order to make this particular case work, create an ~/emacs.d/gtkrc file with 
your style above in it, and say:

widget_class "*Menu*" style "menufont"

Only Emacs reads ~/emacs.d/gtkrc so in that file one can use a more "fuzzy" 
matching in widget and widget_class.  You can of course do the same in 
~/.gtkrc-2.0, but that would affect all applications.

	Jan D.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: gtk Emacs: how specify menu font?
  2003-03-21 14:23     ` Jan D.
@ 2003-03-21 15:25       ` Robert J. Chassell
  0 siblings, 0 replies; 5+ messages in thread
From: Robert J. Chassell @ 2003-03-21 15:25 UTC (permalink / raw)
  Cc: emacs-devel

   > How do I specify a background color for both the menubar and the sub
   > menus?

   ...  In order to make this particular case work, create an
   ~/emacs.d/gtkrc file with your style above in it,  and say:

        widget_class "*Menu*" style "menufont"


Hurrah!  It works!    [Minor typo:  the file is ~/.emacs.d/gtkrc
                                                  ^
                                                  note dot]

   Only Emacs reads ~/emacs.d/gtkrc so in that file one can use a more "fuzzy" 
   matching in widget and widget_class.  ...

Thank you very much!

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-21 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-18 14:34 gtk Emacs: how specify menu font? Robert J. Chassell
2003-03-18 22:21 ` Jan D.
2003-03-20 21:46   ` Robert J. Chassell
2003-03-21 14:23     ` Jan D.
2003-03-21 15:25       ` Robert J. Chassell

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.