From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Stephen Berman <Stephen.Berman@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: svn icons in the toolbar
Date: Thu, 20 Sep 2007 08:24:46 +0200 [thread overview]
Message-ID: <46F2122E.6050808@swipnet.se> (raw)
In-Reply-To: <87r6kue4el.fsf@escher.local.home>
[-- Attachment #1: Type: text/plain, Size: 909 bytes --]
Stephen Berman skrev:
> I forgot that I am using the gtk-qt engine, which "allows GTK
> applications to use Qt widget styles", including tool bar icons. The
> icons I see are actually KDE icons from
> /opt/kde3/share/icons/crystalsvg/32x32/actions. I assume gtk-qt maps
> the Gnome stock icons to corresponding KDE icons of the selected
> theme. I couldn't find an icon in the crystal theme corresponding to
> system-file-manager, but it may just be that gtk-qt does not handle
> named Gnome icons.
>
Try the attached program. Compile like this:
% gcc -o icon-view icon-view.c `pkg-config gtk+-2.0 --cflags --libs`
If run without arguments, it lists the named icons Gtk+ knows about. The list
may be long, I have 2309 names.
If you give it names as arguments, it displays a tool bar with those icons.
If it just list stock-* names, then the gtk-qt engine only deals with stock icons.
Jan D.
[-- Attachment #2: icon-view.c --]
[-- Type: text/x-csrc, Size: 2147 bytes --]
#include <stdio.h>
#include <libintl.h>
#include <string.h>
#include <gtk/gtk.h>
static gboolean
destroy(GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
gtk_main_quit();
return TRUE;
}
static gint
comp_func(gconstpointer a,
gconstpointer b,
gpointer user_data)
{
return strcmp((const char *)a, (const char *)b);
}
int
main(int argc, char *argv[])
{
gtk_set_locale();
gtk_init(&argc, &argv);
GtkWidget *wmain = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(wmain), "icon-view");
g_signal_connect(G_OBJECT(wmain), "delete-event",
G_CALLBACK(destroy), 0);
GtkWidget *tb = gtk_toolbar_new();
GtkTooltips *wtooltip = gtk_tooltips_new();
gtk_toolbar_set_show_arrow(GTK_TOOLBAR(tb), FALSE);
gtk_toolbar_set_style(GTK_TOOLBAR(tb), GTK_TOOLBAR_ICONS);
size_t i;
if (argc == 1) {
GdkDisplay *gdpy = gdk_display_get_default();
GdkScreen *gscreen = gdk_display_get_default_screen(gdpy);
GtkIconTheme *icontheme = gtk_icon_theme_get_for_screen(gscreen);
GList *list = gtk_icon_theme_list_icons(icontheme, NULL);
list = g_list_sort_with_data(list, comp_func, NULL);
GList *it;
for (it = list; it != NULL; it = g_list_next(it)) {
printf("%s\n", (char *)it->data);
}
return 0;
}
for (i = 1; i < argc; ++i) {
int is_stock = 0;
const char *name = argv[i];
if (strncmp("s:", name, 2) == 0) {
is_stock = 1;
name += 2;
}
GtkToolItem* ti;
if (is_stock) {
ti = gtk_tool_button_new_from_stock(name);
} else {
ti = gtk_tool_button_new(NULL, NULL);
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(ti), name);
}
gtk_tool_item_set_expand(ti, TRUE);
gtk_tool_item_set_tooltip(ti, wtooltip, name, NULL);
gtk_toolbar_insert(GTK_TOOLBAR(tb), GTK_TOOL_ITEM(ti), -1);
}
gtk_container_add(GTK_CONTAINER(wmain), tb);
gtk_widget_show_all(wmain);
gtk_main();
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-09-20 6:24 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 23:56 SVG support(again) ? joakim
2007-08-09 21:17 ` joakim
2007-08-09 21:36 ` David Kastrup
2007-08-09 21:45 ` Jason Rumney
2007-08-09 21:58 ` joakim
2007-08-09 21:48 ` joakim
2007-08-11 5:05 ` Richard Stallman
2007-08-14 11:57 ` joakim
2007-08-14 23:26 ` Richard Stallman
2007-08-15 7:11 ` Mathias Dahl
2007-08-16 9:03 ` joakim
2007-08-17 0:32 ` Richard Stallman
2007-08-18 11:44 ` joakim
2007-08-19 0:45 ` Richard Stallman
2007-08-19 12:35 ` joakim
2007-08-19 22:30 ` Richard Stallman
2007-08-20 9:31 ` joakim
2007-08-21 14:45 ` Richard Stallman
2007-08-21 14:59 ` joakim
2007-08-22 4:12 ` Glenn Morris
2007-08-22 7:23 ` joakim
2007-08-29 16:27 ` svn icons in the toolbar (was: SVG support(again) ?) Leo
2007-08-30 5:08 ` svn icons in the toolbar Jan Djärv
2007-08-30 20:44 ` Leo
2007-08-31 5:59 ` Jan Djärv
2007-08-31 7:07 ` Benjamin Hawkes-Lewis
2007-09-01 13:57 ` Leo
2007-08-30 20:50 ` Richard Stallman
2007-09-02 0:33 ` Leo
2007-09-03 3:04 ` Richard Stallman
2007-09-03 6:26 ` Jan Djärv
2007-09-04 0:56 ` Richard Stallman
2007-09-03 7:08 ` Benjamin Hawkes-Lewis
2007-09-03 7:53 ` joakim
2007-09-03 7:55 ` Leo
2007-09-03 17:38 ` David Reitter
2007-09-04 0:56 ` Richard Stallman
2007-09-04 4:01 ` tomas
2007-09-04 22:57 ` Richard Stallman
2007-09-05 3:31 ` tomas
2007-09-04 4:54 ` YAMAMOTO Mitsuharu
2007-09-04 6:06 ` David Kastrup
2007-09-04 22:57 ` Richard Stallman
2007-09-05 0:20 ` YAMAMOTO Mitsuharu
2007-09-05 20:02 ` Richard Stallman
2007-09-05 20:40 ` Chong Yidong
2007-09-05 22:54 ` Leo
2007-09-06 6:02 ` Jan Djärv
2007-09-06 6:00 ` Jan Djärv
2007-09-07 6:32 ` Richard Stallman
2007-09-07 7:04 ` Leo
2007-09-07 8:12 ` Jan Djärv
2007-09-07 10:22 ` Leo
2007-09-08 7:01 ` Richard Stallman
2007-09-07 7:10 ` Jan Djärv
2007-09-08 7:00 ` Richard Stallman
2007-09-03 7:54 ` Leo
2007-09-02 4:32 ` Leo
2007-09-02 8:07 ` Benjamin Hawkes-Lewis
2007-09-02 9:04 ` Jan Djärv
2007-09-02 8:23 ` Jan Djärv
2007-09-02 9:06 ` Leo
2007-09-02 13:29 ` Jan Djärv
2007-09-02 13:52 ` Leo
2007-09-02 14:04 ` Redundant icon in tool-bar (was: svn icons in the toolbar) Leo
2007-09-02 15:39 ` Redundant icon in tool-bar Jan Djärv
2007-09-02 16:00 ` Leo
2007-09-02 14:09 ` svn icons in the toolbar Leo
2007-09-02 15:43 ` Jan Djärv
2007-09-02 16:00 ` Leo
2007-09-02 17:28 ` Jan Djärv
2007-09-05 23:53 ` Leo
2007-09-26 20:11 ` gmm-tool-bar-style (was: svn icons in the toolbar) Reiner Steib
2007-09-02 17:46 ` svn icons in the toolbar Jan Djärv
2007-09-02 17:58 ` Leo
2007-09-21 10:24 ` Leo
2007-09-21 11:13 ` Jan Djärv
2007-09-21 11:17 ` Leo
2007-09-21 12:08 ` Jan Djärv
2007-09-21 12:45 ` Leo
2007-09-21 13:08 ` Jan Djärv
2007-09-21 14:18 ` Leo
2007-09-21 15:14 ` Jan Djärv
2007-09-21 16:03 ` Leo
2007-09-18 21:55 ` Stephen Berman
2007-09-19 6:26 ` Jan Djärv
2007-09-19 9:10 ` Stephen Berman
2007-09-19 9:20 ` Stephen Berman
2007-09-19 9:54 ` Leo
2007-09-19 10:08 ` Jan Djärv
2007-09-19 10:40 ` Stephen Berman
2007-09-19 10:02 ` Jan Djärv
2007-09-19 10:41 ` Stephen Berman
2007-09-20 16:35 ` Richard Stallman
2007-09-24 15:56 ` Stephen Berman
2007-09-25 10:44 ` Richard Stallman
2007-09-25 11:43 ` Frank Schmitt
2007-09-25 13:54 ` Stephen Berman
2007-09-26 6:17 ` Jan Djärv
2007-09-26 16:29 ` Richard Stallman
2007-09-26 16:43 ` Dan Nicolaescu
2007-09-19 21:22 ` Stephen Berman
2007-09-20 6:24 ` Jan Djärv [this message]
2007-09-24 15:56 ` Stephen Berman
2007-09-24 16:04 ` Jan Djärv
2007-11-04 13:24 ` Stephen Berman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46F2122E.6050808@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=Stephen.Berman@gmx.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).