Re: scrollbar once again
- From: Ronald Bultje <rbultje ronald bitfreak net>
- To: Havoc Pennington <hp redhat com>
- Cc: gtk-list gnome org
- Subject: Re: scrollbar once again
- Date: Wed, 9 May 2001 19:11:56 +0200
On 2001.05.09 17:19:22 +0200 Havoc Pennington wrote:
>
> Ronald Bultje <rbultje ronald bitfreak net> writes:
> > I found that commeting out the line:
> > gdk_window_set_user_data (widget->window, widget);
> > fixed it, partly (in gtk_enhanced_scale_realize())
>
> This just means the scale won't get any events (the reason you're
> setting this data is so that when an event occurs on the GdkWindow,
> GTK knows which widget to send that event to).
Then, the scale must be killing the delete signals...
I guess......
But that doesn't make sense, I cannot remember having killed off signals..
And besides, can widgets kill signals going to other widgets? (I know
widgets can kill signals to prevent them from going to the next signal
handler on that specific widget, but can they kill signals to other
widgets?)
> > This function I commented out *should* set the user data of the window
> > itself to what it is, sounds like a circel to me, maybe that was the
> > problem?
>
> No, doubtful.
>
> Hang on - were you connecting destroy/delete_event on the toplevel
> GtkWindow or on your scale widget? I mean on the toplevel window.
On the toplevel window:
gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC
(delete_event), NULL);
gtk_signal_connect (GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC
(destroy), NULL);
I also noticed these two function calls in gtk_enhanced_scale_realize():
widget->window = gtk_widget_get_parent_window (widget);
gdk_window_ref (widget->window);
(I took some parts of the code almost 100% directly from GtkRange)
This doesn't seem right, all my other widgets make their own GdkWindow
(gdk_window_new()) instead of taking the parents'. Uncommenting this part
also has positive effects on widget behaviour (it works correctly now).
Okay, Notition 1 - never take code directly without reading over it at
least twice.
Doesn't that code take the GdkWindow of the parent directly? the parent is,
in this case, the gtk-window itself.... So..... That might be/have been the
problem.
Ronald
--
---------------------------------------------------.
-- .-. | Ronald Bultje |
-- /V\ | Running: Linux 2.4.4 and OpenBSD 2.8 |
-- // \\ | E-mail : rbultje ronald bitfreak net |
-- /( )\ | WWW : http://ronald.bitfreak.net/ |
-- ^^-^^ | *** Warning: Unix Addicted *** |
---------------------------------------------------'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]