[Mono-list] Gecko.WebControl and the Public Events

Jérôme Martin gooogle at free.fr
Sat Feb 23 21:53:23 EST 2008


Hi,

I'm currently using Gecko.WebControl class to do a little Brower.

I successfully did it and my application work. But only for a single 
page view.

So i would like to do like firefox: have tab page when i click center on 
link, but it's now i have 2 problems with events.

1 - DomMouseClick and all the Dom* Events : how to use it ? when i had 
the handler, this works : it jump to my function on_webCtrl_DomMouseClick.

/this.webCtrl.DomMouseClick += new 
DomMouseClickHandler(on_webCtrl_DomMouseClick);/

but i have always this kind of errors when i click on the webcontrol :

Unhandled Exception: System.InvalidCastException: Cannot cast from 
source type to destination type.
  at Gecko.WebControl.DomMouseClickSignalCallback (IntPtr arg0, IntPtr 
arg1, IntPtr gch) [0x00000]
  at (wrapper native-to-managed) 
Gecko.WebControl:DomMouseClickSignalCallback (intptr,intptr,intptr)
  at (wrapper managed-to-native) Gtk.Application:gtk_main ()
  at Gtk.Application.Run () [0x00000]
  at BrowserSharp.Driver..ctor (System.String[] args) [0x001b1] in 
/home/gooogle/Projects/BrowserSharp/Driver.cs:96
  at BrowserSharp.Driver.Main (System.String[] args) [0x00000] in 
/home/gooogle/Projects/BrowserSharp/Driver.cs:42

In fact, i don't know at all how use the Dom* Events because i each time 
have this error. What i have to do ? Is it the good way to get the click 
event on the webcontrol ? because even if i had the GTK handler 
ButtonPressEvent to my webcontrol, it's still don't work...

this.webCtrl.ButtonPressEvent += new 
ButtonPressEventHandler(on_webCtrl_ButtonPress);
(i never go to my method on_webCtrl_ButtonPress)

So that why i supposed i have to get the dom event to able to get it.


2 - how does work the NewWindow Event for WebControl ?

when i had handler to it, it's works (i go to my method):

this.webCtrl.NewWindow += new NewWindowHandler(on_webCtrl_NewWindow);

But what can i do here ? What i'm suppose to do here ?
I saw it exist a NewEmbed field in the NewWindowArgs, but i can't get it 
(on Mono Documentation, it's told : ** 
<http://www.go-mono.com/docs/monodoc.ashx?link=P%3aGecko.NewWindowArgs.NewEmbed>*NewEmbed 
<http://www.go-mono.com/docs/monodoc.ashx?link=P%3aGecko.NewWindowArgs.NewEmbed>* 
[write-only]     /WebControl 
<http://www.go-mono.com/docs/monodoc.ashx?link=T%3aGecko.WebControl>/. 
Documentation for this section has not yet been entered.

So how can i use it ? Do i have to create a new WebControl to put the 
new Window ? how can i tell the first webcontrol to don't go to the new 
link ? Do a WebControl manager many pages ?

To begin this work, i found on the mono site this link:
http://forge.novell.com/modules/xfref_library/detail.php?reference_id=1618
but it doesn't mention how to use DOM...

Thank to read me,

sincerely,

Jérôme Martin (GOoOGle)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080224/06e0fded/attachment.html 


More information about the Mono-list mailing list