Drag the whole window just by dragging the Image placed on it?

  • Hi All,



    I can move a Window i.e. a NSWindow object with the just a simple call
    [myWindow setMovableByWindowBackground:TRUE]. This makes window movable from
    every point I drag my mouse pointer. Now if I place an NSImage Object over
    the window and try to drag the whole window there by only dragging the Image
    , it does not works.

    Is there is any way to drag the whole window just by dragging the Image
    placed on it?



    Thanks in advance!



    Regards,

    Rahul
  • Hmm, i would subclass NSImage making it sending data to its window.
    But...I'm curious to see how others would do this.

    Luca C.

    Il giorno 23/gen/09, alle ore 10:54, "Rahulkumar" <rahulkumar_tibdewal...>
    > ha scritto:

    > Hi All,
    >
    >
    >
    > I can move a Window i.e. a NSWindow object with the just a simple call
    > [myWindow setMovableByWindowBackground:TRUE]. This makes window
    > movable from
    > every point I drag my mouse pointer. Now if I place an NSImage
    > Object over
    > the window and try to drag the whole window there by only dragging
    > the Image
    > , it does not works.
    >
    > Is there is any way to drag the whole window just by dragging the
    > Image
    > placed on it?
    >
    >
    >
    > Thanks in advance!
    >
    >
    >
    > Regards,
    >
    > Rahul
    >
    >
    >
    > _______________________________________________
    >
    > Cocoa-dev mailing list (<Cocoa-dev...>)
    >
    > Please do not post admin requests or moderator comments to the list.
    > Contact the moderators at cocoa-dev-admins(at)lists.apple.
  • Use an NSImageView subclass to draw your image. Put this code in the
    subclass:

    - (BOOL)mouseDownCanMoveWindow
    {
    return YES;
    }

    On 23-Jan-09, at 4:54 AM, Rahulkumar wrote:

    > Hi All,
    >
    >
    >
    > I can move a Window i.e. a NSWindow object with the just a simple call
    > [myWindow setMovableByWindowBackground:TRUE]. This makes window
    > movable from
    > every point I drag my mouse pointer. Now if I place an NSImage
    > Object over
    > the window and try to drag the whole window there by only dragging
    > the Image
    > , it does not works.
    >
    > Is there is any way to drag the whole window just by dragging the
    > Image
    > placed on it?
    >
    >
    >
    > Thanks in advance!
    >
    >
    >
    > Regards,
    >
    > Rahul
previous month january 2009 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today