moz-bonobo-list
[Top][All Lists]
Advanced

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

Re: [moz-bonobo-list] Calling javascript or changing the location from a


From: Luca Padovani
Subject: Re: [moz-bonobo-list] Calling javascript or changing the location from a bonobo control
Date: Tue, 23 Mar 2004 10:22:14 +0100

Hi,

I've been playing with the notification mechanism to make the browser
open a new page as s result of an event from a bonobo control. I've
followed Jean's instruction farily closely. In the control factory I
have

BonoboEventSource* evs = bonobo_event_source_new();
bonobo_object_add_interface(BONOBO_OBJECT(control), BONOBO_OBJECT(evs));

then when an action should cause the browser to change page:
(control_data is a record of data associated with the control)

BonoboObject* evs = bonobo_object_query_local_interface(
  BONOBO_OBJECT(control_data->control),
  "IDL:Bonobo/EventSource:1.0");
if (evs != NULL)
  {
    BonoboArg* arg = bonobo_arg_new(BONOBO_ARG_STRING);
    BONOBO_ARG_SET_STRING(arg, url);
    bonobo_event_source_notify_listeners (evs, "URL", arg, NULL);
    bonobo_arg_release(arg);
    bonobo_object_unref(BONOBO_OBJECT(evs));
  }

(url is a string with the URL to be opened).

The code is executed at the right time and with the right parameters,
but unfortunately the browser does not react to the notification. I've
also added EventSource among the implemented interfaces in the .server
file for the control, nothing has changed (BTW, am I supposed to do
this?)

My guess is I'm missing something obvious here, does anyone have any
clue?

TIA,
--luca





reply via email to

[Prev in Thread] Current Thread [Next in Thread]