If you wrap your widget in a FocusPanel, you can catch mouse and 
keyboard events.

- lars

Manik Chand wrote:
> Can we add element of Horizontal panel instead of Image to catch mouse 
> event.
>
> On Thu, Aug 2, 2007 at 8:12 PM, krispy <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
>     Hey Budric - comments inline.
>
>     > 1.  I'm using it in NetBeans through GWT4NB plugin.  I'm trying
>     to add
>     > a style sheet to the project.  How is that done?  I see DynaTable
>     > sample links the style sheet into HTML.  The KitchenSink puts it in
>     > *.gwt.xml file as <stylesheet>.  This option doesn't work for
>     me.  The
>     > style isn't applied and I don't know why.  I don't know if the
>     > compiler is not seeing it or it's invalid or what...I'm under the
>     > impression that the *.js file should contain the reference to
>     the css
>     > file and write it into the document.
>
>     You're supposed to be able to do the <stylesheet> thing in the module
>     file - I don't know, I've never tried.  Usually the stylesheet goes
>     into the <head> of your HTML document.  Put the following line in:
>
>     <link rel='stylesheet' href='MyStyleSheet.css'/>
>
>     > 2.  How can I add my package to a module?  So far it seems any
>     classes
>     > outside *.client package that you import aren't compiled.  Makes
>     > sense, but this is my own package I'm writing just to separate the
>     > code a bit and I want to be able to import that package.
>
>     You can do a couple of things - if I remember rightly, one is to set
>     up a separate gwt.xml file that contains definitions for your other
>     packages, then inherit it in your other modules that need it.  The
>     simplest thing to do, IMO, is to change the <source> tag in your
>     current gwt.xml file to point at other packages.  It defaults to
>     looking at /client only for client side source:
>
>     
> http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.Modules.ModuleXml.html
>
>     If you have a structure like this:
>
>     /com/mycompany/gwt/client
>     /com/mycompany/gwt/otherstuff
>     /com/mycompany/gwt/otherstuff/morestuff
>
>     then what you would add to your gwt.xml file is:
>
>     <source path="client"/>
>     <source path="otherstuff"/>
>
>     If you have something like this:
>
>     /com/mycompany/gwt/client
>     /com/mycompany/otherstuff
>
>     Then you would have to set up another gwt.xml file at com/mycompany,
>     or else move your current one com/mycompany and use
>
>     <source path="gwt"/>
>     <source path="otherstuff"/>
>
>     since the module loads source relative to your gwt.xml file.
>
>     > 3.  I'm using Image.setUrl() to scroll through some images hosted by
>     > the server.  It seems that these images are not cached by the
>     client's
>     > browser (IE/Firefox).  Anyone know why?
>
>     You might need to change your browser settings, but more likely you
>     need to make sure your web server is configured correctly and sending
>     the right headers.  It depends greatly on what your response headers
>     look like, really - but I'm not sure if it's possible to have a
>     browser setting that ignores those headers and doesn't cache
>     anything?  Search these forums more for "cache response" to find the
>     right headers.
>
>     > 4.  I'm trying to capture some dragging events on an image.  This
>     > doesn't work.  The mouse down is captured, then as you start to drag
>     > the mouse cursor changes, and mousemove, mouse up (most
>     important) are
>     > not reported.  Note that the image would not be moving with the
>     mouse
>     > cursor.  Anyone know a solution to this?  Overlaying some sort of a
>     > control on top of an image to capture the events may solve the
>     > problem, but I don't know how to layer one control on top of another
>     > (especially since I can't get my css to work!).
>
>     Make sure that your image is set as the capture element with
>     DOM.setCapture(Element).  Otherwise, when you move the mouse too fast
>     it'll lose the events (b/c it'll do a mouse leave, I think).  It's
>     hard to know if this is actually the problem until we see some source
>     as to how you're catching events and responding to them.
>
>     > Thanks a lot for any help.
>
>     Anytime - that's what we're here for.
>
>     -krispy
>
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to