After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 101987 - Widget/class paths unknown for menus and dialogs
Widget/class paths unknown for menus and dialogs
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-12-26 14:31 UTC by Jan D.
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
names.c (2.01 KB, text/plain)
2002-12-26 14:56 UTC, Jan D.
Details

Description Jan D. 2002-12-26 14:31:12 UTC
Problem:
One can not customize parts of GTK, since the widget and class paths are
unknown.

Please look at the attached code.
It creates a main window, a menubar and one menu.  Also, it creates a
GtkFileSelection when "Open..." is selected from the menu.

The names set for widgets are:
GtkWindow(menutest).GtkVBox(vbox).GtkMenuBar(menubar)

Also,
GtkMenu(filemenu).GtkMenuItem(menuitem_1 and menuitem_2).

GtkFileSelection(file_dialog).

To change style for the menu, I assumed this would work:
widget "menutest.vbox.menubar*" style "my_style"

Alas, it does not change style of the menu items, only the menu bar itself.

Even this does not work:
widget "menutest*menuitem*" style "my_style"

But this does:
widget "*menuitem*" style "my_style"

but now I have lost the information that only menu items under "menutest"
shall be customized.  I could rename my menu items "menutest_menuitem_n",
so then ""menutest*menuitem*" would work.  But this is not a general solution.

I can not say "Apply this style to everything created by menutest" in
principle like this (fixing the names), because some names are unknown. 
Take the file selection dialog.  I would like to customize that.  I name it
"file_dialog", so I can say
widget "*file_dialog*" style "my_style"

But again, we loose the information that we really only mean file dialogs
created by "menutest".  Also, this does not customize the option menu or
the dialogs created by file selection itself, for example, when pressing
the "New Folder" there is a dialog popped up, this is not affected by
widget "*file_dialog*"

In fact, there is no documented way at all to customize a file dialog or
menus created by one application, since the file dialog names used aren't
documented.  This does not customize menus or dialogs used by a file dialog
either:
widget_class "*GtkFileSelection*" style "my_style"

Contrast this to Xt, where I can say (for a Motif compiled emacs)
emacs*background: red

and all widgets, menus, dialogs use red as background.

I'd like to see something similar in GTK, so that menus and dialogs pick up
the path names from their parents.  They don't seem to do so now.
Comment 1 Jan D. 2002-12-26 14:56:36 UTC
Created attachment 13223 [details]
names.c
Comment 2 Owen Taylor 2002-12-26 20:06:29 UTC
The use of gtkrc for customizing complicated widget paths
is really not encouraged, so we aren't going to extend
it at all. How it works (with the exception of bugs) is 
how it is going to work.

Note that GtkMenu widgets are inside a (automatically created)
GtkWindow widget ... so you need paths like GtkWindow.GtkMenu
(or *.GtkMenu) not GtkMenu

There might be some bug in the:

> widget "menutest.vbox.menubar*" style "my_style"
>
> Alas, it does not change style of the menu items, only the menu bar
> itself.

I saw something like this a few weeks ago but didn't have 
time to investigate further. (If you play around a little bit
you'll be able to find variants that work.)
Comment 3 Owen Taylor 2003-01-23 20:19:44 UTC
Cannot reproduce any problems with paths of the form:

widget_class "*GtkMenuBar*" style "menubaritem"

Which is what I thought I was seeing problems with before. 
They seem to work fine