(Bit of old stuff, I've been away ...)

muppet <[EMAIL PROTECTED]> writes:
>
> Solution:  Don't put the DrawingArea inside a ToggleButton.

Yep.

> When you gtk_widget_add() the DrawingArea to the ToggleButton, you  
> make the DrawingArea's GdkWindow a child of the ToggleButton's  
> GdkWindow.

Nosing around with xwininfo suggests that doesn't happen, instead the
GdkWindow "event_window" gets plonked on top of any child widget's
GdkWindow.  So the original posted code is helped for me for instance by

    $draw->window->raise;

after the show_all.  Though breaking the button's press action ...

> That means that the ToggleButton's GdkWindow gets first  
> crack at all the events.

For what it's worth, I believe it's the other way around, the sub-window
gets first go.

> Normally, all you put inside a toggle button  
> are no-window widgets, like GtkLabel or GtkImage, so this isn't a  
> problem.

Looks like the InputOnly event_window in the button lets children
drawing in their own windows still work, but no interaction.  I suppose
it makes sense to have the button handle events and just have the
children do drawing, even if it's not quite obvious.
_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Reply via email to