[mochikit] Re: how to pan div contents

2006-11-11 Thread troels knak-nielsen

Show us your code.

On 11/10/06, Diez B. Roggisch [EMAIL PROTECTED] wrote:

 Hi,

 I'm currently creating a TurboGears Tile-widget, like google maps has
 for example. So far things are smooth, displaying and moving work.

 Now what I would love to do is to enable that panning of the contents of
 that widget - moving around the tiles via dragging.

 I tried and look into the DragAndDrop-code, but for some reasons my
 feeble attempts don't work out - I get this error:


 Exception... 'Error: 'objOrFunc' must be a function if 'funcOrStr' is
 not given' when calling method: [nsIDOMEventListener::handleEvent]
 nsresult: 0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT) location:
 unknown data: no]

 This is Firefox 1.5 on mac os x, btw.

 The HTML looks like this:

 div id=tileswidget
div !-- a column --
  div  !-- a tile --
img .../
spansome text/span
  /span
  ...
/div
...
 /div

 I tried to connect  various onmouse*-events from the tileswidget or the
 window - no success so far.

 Any hints on how to proceed?


 Regards,

 Diez

 



-- 
troels

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



[mochikit] Re: how to pan div contents

2006-11-11 Thread Diez B. Roggisch

troels knak-nielsen schrieb:
 Show us your code.

logDebug(connect dragging events);
 var conn = MochiKit.Signal.connect;

this.eventMouseUp = conn(document, 'onmouseup', this, initDrag);
this.eventMouseMove = conn(document, 'onmousemove', this, initDrag);
this.eventKeypress = conn(document, 'onkeypress', this, initDrag);
this.eventMouseUp = conn(vp, 'onmouseup', this, initDrag);
this.eventMouseMove = conn(vp, 'onmousemove', this, initDrag);
this.eventKeypress = conn(vp, 'onkeypress', this, initDrag);

 initDrag : function(event) {
 logDebug(initDrag);
this.old_pointer = event.mouse().pointer;
 },



The error when connecting is gone, after I changed the connection call from

conn(src, signal, dest, dest.function)

to

conn(src, signal, dest, function)

However, I don't get initDrag called ever.

Diez

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