Re: [gtk-list] Re: menu



On Sat, 18 Apr 1998, Federico Mena wrote:
> >  When i click with button 3 in the textarea the menu shows up and acts
> >  as it should (just like in netscape when you click with button 3.)
> >  
> >  But, heres the kicker, the netscape menu "knows" where the click
> >  occured in its window and can modify the menu to fit the type of 
> >  data you clicked on.  i need to do the same thing.
> 
> I haven't tried this, but it may work.  Instead of using
> gtk_signal_connect to bind to the button press, use
> gtk_signal_connect_after.


The gtk_signal_connect_after didn't work but i did hackup a workaround
for now, but i still need a better way to do it.

This is what i did:
I changed three functions in gtktext.c fron static to nonstatic. 
Then called them from my app.  They are:

  undraw_cursor (text, FALSE);
  find_mouse_cursor (text, (gint)button->x, (gint)button->y);
  draw_cursor (text, FALSE);

this allowed me to use gtk_emit_stop_by_name but still have the cursor
set in the textarea.

I think giving the programmer an easy way to popup a menu inside of any widget
needs to be addressed.  

Something like this might be in order.

  gtk_signal_connect(GTK_OBJECT (text), 
		     "pass_button1_ON_button3_click",
		     /*"pass_button3_ON_button3_click",*/
		     /*"pass_none_ON_button3_click",*/
		     GTK_SIGNAL_FUNC (pop_mymenu),
		     NULL);

Of course making this a signal "thing" probably isn't a great idea, but
there needs to be some way to do this easily.

matt wimer

> 
>   Quartic





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