Widgets in a GtkMenu - focus problems



Hi,

So I know that it is not recommended but I have been trying to get an
arbitrary GtkWidget working in a GtkMenu by making a special
GtkMenuItem (ContainerMenuItem) in Vala.

I have already got things like
motion/enter-notify/leave-notify/button-press/release-events working,
however I have hit an obstacle - getting focus on a widget

For example, I am trying to get a GtkEntry to grab focus on its
button-press-event (which it should do because of line 3846 in
gtkentry.c), however the GtkEntry does not gain focus.

I did a bit of hacking around to find where the issue is, but I can't
find it, all I know is that lines 6652 - 6658 are run in
gtk_widget_real_grab_focus() and that the widgets that are iterated
through in the set_focus_child loop are:

GtkEntry
GtkBox
ContainerMenuItem
GtkMenu
GtkWindow

I really need some help :/


Code is located here:
---------------------------------------------------------------------------------------
ContainerMenuItem.vala      http://pastebin.com/tU6LXPkH
app.vala                             http://pastebin.com/w5S3XQLT


--
Andrew Higginson


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]