Re: GtkComboBox and focus change events: Bug?
| From: | André Jansen | Date: | Wed, 15 Mar 2006 13:34:32 +0000 |
| Subject: | Re: GtkComboBox and focus change events: Bug? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6792@lists.php.net to get a copy of this message | ||
On 15 Mar 2006 at 3:47, Steph Fox wrote:
> Hi André,
>
> GtkComboBox is derived from GtkBin, which is a non-windowed widget, and
> yeah normally you'd expect to be able to override the behaviour with
> GtkEventBox - but I think you're probably right about the widget being too
> complex for that. Just to give you some idea, the original piece of code
> in GTK+ source opens up with:
>
> /* WELCOME, to THE house of evil code */
Yeow! Wicked Uncle Ernie lives there... :)
> BTW, if it's a bug at all it'll be a GTK+ bug - the only way it's useful
> to report it to the PHP-GTK team is as a documentation bug. We don't do a
> great deal with GTK+ signals.
>
> I changed your script a little to experiment with this stuff:
>
> function printFocus($combo, $direction) {
> if($direction) echo ($direction)."\n";
> }
>
> $combo->connect('focus', 'printFocus');
>
> // output refers to Gtk::DIRECTION_TYPE; 2 == Gtk::DIR_UP, 3 ==
> Gtk::DIR_DOWN
> 3
> 2
> 3
> 2
>
> The 'focus' signal doesn't carry a GdkEvent, just an enum telling you
> which direction keyboard focus came in from or is going out to. I haven't
> played with setting up an entire ComboBox (with treestore et al) - I'm
> hopeful you'll find that the GtkTreeview lurking within the private
> structure will allow for focus-in/out events, which would make some sense
> here. (But the treemodel alone definitely will not).
It appears impossible to get at the GtkTreeView... "private" here really
means "private"...
If there's any trick to get around this, I'd be delighted to know.
Cheers,
--
André
===========================================================
I'm out of my mind, but feel free to leave a message...