[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] GTK3 version
From: |
Josue Abarca |
Subject: |
Re: [Denemo-devel] GTK3 version |
Date: |
Tue, 2 Oct 2012 02:22:06 -0600 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Oct 01, 2012 at 12:10:14PM +0100, Richard Shann wrote:
...
> This is curious indeed, while looking at the question of Esc and arrows
> (see other email) I came across the relevant bit of code
>
> #if GTK_MAJOR_VERSION == 3
> action =
> gtk_activatable_get_related_action(gtk_menu_get_active(GTK_MENU(menu)));
> #else
> action =
> gtk_widget_get_action(GTK_MENU_SHELL(menu)->active_menu_item);//note this is
> not gtk_menu_get_active(menu) except after a selection has been made, we want
> the menu item that the pointer has moved to before it is selected.
> #endif
>
> The second definition of the action is the one I wrote (for GTK2) and I
> obviously had a struggle to get at the highlighted item, hence my note
> and my access to the structure itself. Jeremiah would have created the
> alternative for GTK3, and for GTK2 this yields the first menu item every
> time, because the highlighted item is not selected until you release the
> mouse button (when it is too late to take action).
> That it actual works on some versions of GTK3 and not others is strange.
> If someone compiling with GTK3 could test the following replacement for
> the above:
>
> action = gtk_activatable_get_related_action(gtk_menu_shell_get_selected_item(
> GTK_MENU_SHELL(menu)));
>
> that would be interesting. This (gtk_menu_shell_get_selected_item) is a
> new accessor in GTK3, and may be the right thing to use. The name of
> this function is less promising than the one currently in use, however.
> As usual the documentation is vague.
>
> Richard
I have tested this (gtk_menu_shell_get_selected_item), and for me,
Denemo keeps working fine :).
You can see attached the change(patch) that I made.
$ ldd /tmp/denemo/bin/denemo | grep gtk
libgtksourceview-3.0.so.0 =>
/usr/lib/x86_64-linux-gnu/libgtksourceview-3.0.so.0
(0x00007fbe96f19000)
libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fbe96005000)
--
Josué M. Abarca S.
Vos mereces Software Libre.
PGP key 4096R/70D8FB2A 2009-06-17
Huella de clave = B3ED 4984 F65A 9AE0 6511 DAF4 756B EB4B 70D8 FB2A
0003-Use-gtk_menu_shell_get_selected_item-instead-of-gtk_.patch
Description: Text Data