* Should we relax requirement from gtk 2.6 to gtk 2.4.
@ 2007-09-05 22:33 David Koppelman
2007-09-05 22:59 ` Leo
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: David Koppelman @ 2007-09-05 22:33 UTC (permalink / raw)
To: emacs-devel
Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
accommodate a use of gtk_image_new_from_icon_name and
gtk_image_set_from_icon_name. If that's all, then perhaps it would be
better to use 2.4-compatible functions to do the same thing.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-05 22:33 Should we relax requirement from gtk 2.6 to gtk 2.4 David Koppelman
@ 2007-09-05 22:59 ` Leo
2007-09-06 8:42 ` David Hansen
2007-09-06 5:33 ` David Kastrup
2007-09-06 6:02 ` Jan Djärv
2 siblings, 1 reply; 9+ messages in thread
From: Leo @ 2007-09-05 22:59 UTC (permalink / raw)
To: emacs-devel
On 2007-09-05 23:33 +0100, David Koppelman wrote:
> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
> accommodate a use of gtk_image_new_from_icon_name and
> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
> better to use 2.4-compatible functions to do the same thing.
2.10 has been out for a long time. What's the merit of using 2.4?
GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.14, multi-tty)
of 2007-09-01
--
Leo <sdl.web AT gmail.com> (GPG Key: 9283AA3F)
Gnus is one component of the Emacs operating system.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-05 22:33 Should we relax requirement from gtk 2.6 to gtk 2.4 David Koppelman
2007-09-05 22:59 ` Leo
@ 2007-09-06 5:33 ` David Kastrup
2007-09-07 6:31 ` Richard Stallman
2007-09-06 6:02 ` Jan Djärv
2 siblings, 1 reply; 9+ messages in thread
From: David Kastrup @ 2007-09-06 5:33 UTC (permalink / raw)
To: David Koppelman; +Cc: emacs-devel
David Koppelman <koppel@ece.lsu.edu> writes:
> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
> accommodate a use of gtk_image_new_from_icon_name and
> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
> better to use 2.4-compatible functions to do the same thing.
Multitty support crashed IIRC upon closing the last frame on a
terminal.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-05 22:33 Should we relax requirement from gtk 2.6 to gtk 2.4 David Koppelman
2007-09-05 22:59 ` Leo
2007-09-06 5:33 ` David Kastrup
@ 2007-09-06 6:02 ` Jan Djärv
2007-09-06 15:52 ` David Koppelman
2 siblings, 1 reply; 9+ messages in thread
From: Jan Djärv @ 2007-09-06 6:02 UTC (permalink / raw)
To: David Koppelman; +Cc: emacs-devel
David Koppelman skrev:
> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
> accommodate a use of gtk_image_new_from_icon_name and
> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
> better to use 2.4-compatible functions to do the same thing.
AFAIK, there are no 2.4-compatible functions to do just that. Do you know any?
Jan D.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-05 22:59 ` Leo
@ 2007-09-06 8:42 ` David Hansen
2007-09-06 9:04 ` Jan Djärv
0 siblings, 1 reply; 9+ messages in thread
From: David Hansen @ 2007-09-06 8:42 UTC (permalink / raw)
To: emacs-devel
On Wed, 05 Sep 2007 23:59:10 +0100 Leo wrote:
> On 2007-09-05 23:33 +0100, David Koppelman wrote:
>> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
>> accommodate a use of gtk_image_new_from_icon_name and
>> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
>> better to use 2.4-compatible functions to do the same thing.
>
> 2.10 has been out for a long time. What's the merit of using 2.4?
Cairo dependency or was that added later?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-06 8:42 ` David Hansen
@ 2007-09-06 9:04 ` Jan Djärv
0 siblings, 0 replies; 9+ messages in thread
From: Jan Djärv @ 2007-09-06 9:04 UTC (permalink / raw)
To: emacs-devel
David Hansen skrev:
> On Wed, 05 Sep 2007 23:59:10 +0100 Leo wrote:
>
>> On 2007-09-05 23:33 +0100, David Koppelman wrote:
>>> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
>>> accommodate a use of gtk_image_new_from_icon_name and
>>> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
>>> better to use 2.4-compatible functions to do the same thing.
>> 2.10 has been out for a long time. What's the merit of using 2.4?
>
> Cairo dependency or was that added later?
>
2.8 AFAIK.
Jan D.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-06 6:02 ` Jan Djärv
@ 2007-09-06 15:52 ` David Koppelman
2007-09-07 7:19 ` Jan Djärv
0 siblings, 1 reply; 9+ messages in thread
From: David Koppelman @ 2007-09-06 15:52 UTC (permalink / raw)
To: Jan Djärv; +Cc: emacs-devel
> AFAIK, there are no 2.4-compatible functions to do just that. Do you know any?
gtk_icon_theme_load_icon and gtk_image_new_from_pixbuf.
The patch below shows how they might be used. The code compiles but I
don't know if it works because for some reason no icons are being
found (in code upstream of the changes).
--- gtkutil.c 05 Sep 2007 09:17:48 -0500 1.115
+++ gtkutil.c 06 Sep 2007 10:46:25 -0500
@@ -3814,6 +3814,8 @@ update_frame_tool_bar (f)
GtkStockItem stock_item;
char *stock_name = NULL;
char *icon_name = NULL;
+ GdkScreen* const screen = gtk_widget_get_screen(GTK_WIDGET(wtoolbar));
+ GtkIconTheme* const icon_theme = gtk_icon_theme_get_for_screen(screen);
Lisp_Object rtl;
GtkWidget *wbutton = NULL;
GtkWidget *weventbox;
@@ -3844,9 +3846,6 @@ update_frame_tool_bar (f)
stock_name = SSDATA (stock);
if (stock_name[0] == 'n' && stock_name[1] == ':')
{
- GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wtoolbar));
- GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (screen);
-
icon_name = stock_name + 2;
stock_name = NULL;
stock = Qnil;
@@ -3932,7 +3931,10 @@ update_frame_tool_bar (f)
}
else if (icon_name)
{
- w = gtk_image_new_from_icon_name (icon_name, icon_size);
+ GdkPixbuf* const pixbuf =
+ gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,NULL);
+
+ w = gtk_image_new_from_pixbuf(pixbuf);
g_object_set_data_full (G_OBJECT (w), XG_TOOL_BAR_ICON_NAME,
(gpointer) xstrdup (icon_name),
(GDestroyNotify) xfree);
@@ -4029,8 +4031,9 @@ update_frame_tool_bar (f)
else if (icon_name &&
(! old_icon_name || strcmp (old_icon_name, icon_name) != 0))
{
- gtk_image_set_from_icon_name (GTK_IMAGE (wimage),
- icon_name, icon_size);
+ GdkPixbuf* const pixbuf =
+ gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,NULL);
+ gtk_image_set_from_pixbuf(GTK_IMAGE (wimage), pixbuf );
g_object_set_data_full (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME,
(gpointer) xstrdup (icon_name),
(GDestroyNotify) xfree);
Jan Djärv <jan.h.d@swipnet.se> writes:
> David Koppelman skrev:
>> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
>> accommodate a use of gtk_image_new_from_icon_name and
>> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
>> better to use 2.4-compatible functions to do the same thing.
>
> AFAIK, there are no 2.4-compatible functions to do just that. Do you know any?
>
> Jan D.
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-06 5:33 ` David Kastrup
@ 2007-09-07 6:31 ` Richard Stallman
0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2007-09-07 6:31 UTC (permalink / raw)
To: David Kastrup; +Cc: koppel, emacs-devel
Multitty support crashed IIRC upon closing the last frame on a
terminal.
With which Gtk versions does it crash?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Should we relax requirement from gtk 2.6 to gtk 2.4.
2007-09-06 15:52 ` David Koppelman
@ 2007-09-07 7:19 ` Jan Djärv
0 siblings, 0 replies; 9+ messages in thread
From: Jan Djärv @ 2007-09-07 7:19 UTC (permalink / raw)
To: David Koppelman; +Cc: emacs-devel
David Koppelman skrev:
>> AFAIK, there are no 2.4-compatible functions to do just that. Do you know any?
>
> gtk_icon_theme_load_icon and gtk_image_new_from_pixbuf.
>
Not quite. Your patch below does not produce a broken image if the icon is
not found, nor does it make an icon the reacts to theme changes.
Lets move on to 2.6. After all, it is two major versions before the current one.
Jan D.
> The patch below shows how they might be used. The code compiles but I
> don't know if it works because for some reason no icons are being
> found (in code upstream of the changes).
>
> --- gtkutil.c 05 Sep 2007 09:17:48 -0500 1.115
> +++ gtkutil.c 06 Sep 2007 10:46:25 -0500
> @@ -3814,6 +3814,8 @@ update_frame_tool_bar (f)
> GtkStockItem stock_item;
> char *stock_name = NULL;
> char *icon_name = NULL;
> + GdkScreen* const screen = gtk_widget_get_screen(GTK_WIDGET(wtoolbar));
> + GtkIconTheme* const icon_theme = gtk_icon_theme_get_for_screen(screen);
> Lisp_Object rtl;
> GtkWidget *wbutton = NULL;
> GtkWidget *weventbox;
> @@ -3844,9 +3846,6 @@ update_frame_tool_bar (f)
> stock_name = SSDATA (stock);
> if (stock_name[0] == 'n' && stock_name[1] == ':')
> {
> - GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wtoolbar));
> - GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (screen);
> -
> icon_name = stock_name + 2;
> stock_name = NULL;
> stock = Qnil;
> @@ -3932,7 +3931,10 @@ update_frame_tool_bar (f)
> }
> else if (icon_name)
> {
> - w = gtk_image_new_from_icon_name (icon_name, icon_size);
> + GdkPixbuf* const pixbuf =
> + gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,NULL);
> +
> + w = gtk_image_new_from_pixbuf(pixbuf);
> g_object_set_data_full (G_OBJECT (w), XG_TOOL_BAR_ICON_NAME,
> (gpointer) xstrdup (icon_name),
> (GDestroyNotify) xfree);
> @@ -4029,8 +4031,9 @@ update_frame_tool_bar (f)
> else if (icon_name &&
> (! old_icon_name || strcmp (old_icon_name, icon_name) != 0))
> {
> - gtk_image_set_from_icon_name (GTK_IMAGE (wimage),
> - icon_name, icon_size);
> + GdkPixbuf* const pixbuf =
> + gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,NULL);
> + gtk_image_set_from_pixbuf(GTK_IMAGE (wimage), pixbuf );
> g_object_set_data_full (G_OBJECT (wimage), XG_TOOL_BAR_ICON_NAME,
> (gpointer) xstrdup (icon_name),
> (GDestroyNotify) xfree);
>
>
>
> Jan Djärv <jan.h.d@swipnet.se> writes:
>
>> David Koppelman skrev:
>>> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to
>>> accommodate a use of gtk_image_new_from_icon_name and
>>> gtk_image_set_from_icon_name. If that's all, then perhaps it would be
>>> better to use 2.4-compatible functions to do the same thing.
>> AFAIK, there are no 2.4-compatible functions to do just that. Do you know any?
>>
>> Jan D.
>>
>>
>> _______________________________________________
>> Emacs-devel mailing list
>> Emacs-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-devel
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-09-07 7:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-05 22:33 Should we relax requirement from gtk 2.6 to gtk 2.4 David Koppelman
2007-09-05 22:59 ` Leo
2007-09-06 8:42 ` David Hansen
2007-09-06 9:04 ` Jan Djärv
2007-09-06 5:33 ` David Kastrup
2007-09-07 6:31 ` Richard Stallman
2007-09-06 6:02 ` Jan Djärv
2007-09-06 15:52 ` David Koppelman
2007-09-07 7:19 ` Jan Djärv
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).