Re: Problem with toggle menu items in a component



A Qua, 2003-11-05 às 15:22, Jean Bréfort escreveu:
> Hi,
> 
> I tried the following:
> in a ui file:
> <cmd name="foo_cmd".../>
> <menuitem name="foo_cmd" verb="" type="toggle"/>
> 
> and in the C source file:
> static BonoboUIVerb verbs[] = {
> 	BONOBO_UI_VERB ("foo_cmd", on_foo_cb),
> 	BONOBO_UI_VERB_END
> };
> 
> bonobo_ui_component_add_verb_list_with_data(uic, gcp_verbs, control);
> 
> When the control is loaded in a container (nautilus), the menu appears
> but the callback is never called. If I remove type="toggle", the
> callback is called but, of course, I have not the toggle item i would
> like. Is it a bug? Or is ther something I don't understand?

  For toggle items, you are supposed to monitor state changes by
connecting to the 'ui-event' signal of the UI component.  The signature
of the handler is:
       void     ui_event_handler (BonoboUIComponent            *component,
				  const char                   *id,
				  Bonobo_UIComponent_EventType  type,
				  const char                   *state,
				  gpointer                      user_data)

  Regards.

-- 
Gustavo João Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>





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