Re: Your answer in Gnome maillinglist for menu_items

2014-05-05 Thread Emmanuele Bassi
hi;

GtkMenuItem is a GtkBin, so you can use gtk_container_add() to set a
child of a GtkMenuItem like you would do with any other container
inside GTK+.

ciao,
 Emmanuele.


On 5 May 2014 13:23, Jürgen Holtorf  wrote:
> Hallo
>
> The mailing list seams not to work in the moment so i take the direct way to
> contact you.
>
> You wrote:
>
>  * GtkMenuItem, pack an icon with a label inside an horizontal box,
> and pack the box in the menu item
>
> The First part creating a box with icon is clear to me, but i can't
> find a function to "pack the box in the menu item" please can you give
> me a hint, or better an example.
>
> Thanks in advance
>
> Jürgen Holtorf
>
>
>
>
>



-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

GtkSocket: focus to embedded child widget or plug widget

2014-05-05 Thread Gaute Hope
Hi,

note: this message was already sent to gtk-list, but re-sending here as it
might be more appropriate:

I am trying to put the keyboard focus on a widget (or similar) inside a
embedded window of a GtkSocket, but although I am using grab_focus on
the GtkSocket and the plugin seems to be receiving the events (at least
the socket-side window is not anymore) the widget or window does not
have keyboard focus. E.g. in the case of a simple plug with a GtkEntry,
the entry does not have cursor, or if I embed gvim the gvim cursor is
not blinking/active.

I have submitted a bug here:
https://bugzilla.gnome.org/show_bug.cgi?id=729248

I am using Gtk+ git.

It turns out it is possible to give focus to the first widget by
'Tab'-ing into the embedded child, but it does not seem to be a way to
do this programtically. The specific XEMBED signals that are required to
be sent [0] can, as far as I can see, only be sent through the GtkSocket
by the tab-handler.

grab_focus() sends a XEMBED_FOCUS_IN message but with an
XEMBED_FOCUS_CURRENT detail, by replacing ..._CURRENT with _FIRST
the embedded child acts as if Tab has been pressed and the first widget
gets focus.

As you can see from the bug report I created a patch for Gtk where I can
send the focus_forward and backward ( _FIRST and _LAST ) signals. When I
use it the focus changes as expected.

A small example based on gtkmm's socket and plug examples can be found
here:
https://github.com/gauteh/plug-socket-grab-focus/tree/focus_forward

After some discussion on #gtk+ we've also discovered that the testsocket
program appears to give focus to the plugin entry field, but the entry
does not get any key events before it is clicked.

If there is no other way of programatically changing the focus of the
embedded plugin I would greatly appreciate either something like the
patch I include in the bug report or some other way to control the focus
from the socket-side.

By the way, thanks for the helpful discussions on #gtk+.

Best regards, Gaute

[0] 
http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html#idm139742756373280
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list