Re: [gtk-list] Re: button press capture



Thank you, I understand your answer.
But what if I have a label inside a frame and the label does not have a
"button_press_event". Perhaps, I'm making a mistake or missing someting
but with the code that I have, if I click over the label, the event is not
passed to the frame.

All I have is gtk_signal_connect(GTK_OBJECT(frame),...).
Giving the command gtk_widget_set_events(frame, ...) causes
runtime ***warinings***. What am I doing wrong?!

Pavel




On Wed, 16 Jun 1999, Duane Johnson wrote:

> I'm not sure exactly how you want your frame to "respond", but you can add code
> that modifies your frame inside the button_press_event of the entry and/or the
> preview widgets.
> 
> Whenever an event occurs inside a widget, the widget has the option of either
> stopping the event right there, or passing it on to its parent(s).  For
> example, if your "gint mywidget_button_press( ... )" returns a "TRUE" value,
> then you are telling the signal handling process to STOP the signal (I think of
> it this way:  I pretend the signal handling process is asking me the question
> "Did you handle the event?" and I say "TRUE" if I did, or "FALSE" if I want the
> widget's parents to continue handling it)
> 
> As an example, if your preview widget does not have a button_press_event, then
> it could not have handled it, so the event is passed on to its parent (in this
> case, the frame).  If you build a button_press_event for the preview, then you
> can either tell the event to stop there (return TRUE;) or continue to the frame
> (return FALSE;)
> 
> Hope this helps,
> Duane
> 
>  On Wed, 16 Jun 1999, pavel wrote:
> > Hi,
> > 
> > I would like to have the following setup:
> > 
> > A preview and an entry inside a frame. I need for the frame itself to
> > respond to button clicks and if they happen over the preview or the entry
> > to pass them through to the respective widgets. Can someone show me how to
> > do that? I.E. what should my callbacks return, how can I make the frame
> > receive mouse events, etc.
> > 
> > I noticed that I if I simply connect a button_press_event callback to the
> > frame and click inside the entry then the frame callback is called. I'm
> > not quite sure I understand why that happens. Can signals travel from
> > children to parents?.. Anyway, I'm confused.
> > 
> > Pavel
> > 
> > -- 
> > To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 



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