0

For my OSX application. I have a main window with some output. On a button click a new window will pop up with a drawing on its NSView. I am making this second window transparent by setting its background color as transparent with RGB values as 0.0 and also alpha 0.0. So now my second window just have this random drawing on a transparent background. I have put both the windows in the same xib file.

My problem is that, the transparent window with a drawing that pops up is not draggable. I have overriden mouseDragged: (NSEvent *) in my secondwindow:NSWindow class. But still it is not draggable. This method should work when I try to drag my transparent window using trackpad right ? Any help would be very much appreciated . Thanks in advance

1 Answers1

1

Transparent window is not draggable. The only option is to add something like imageview with image, now click and drag the imageview. Total transparent will move.

Muruganandham K
  • 5,271
  • 5
  • 34
  • 62
  • But I had already implemented a sample program with just one window instead of two and in that case I was able to drag the transparent window. In my CustomView in drawRect:(NSRect)rect // Draw the blue rectangle. NSRect myRect = NSMakeRect(20, 10, 200, 100); [[NSColor blueColor] set]; NSRectFill(myRect); – user2905879 Oct 22 '13 at 08:17
  • post your project somewhere else and send me the link – Muruganandham K Oct 22 '13 at 08:28
  • https://www.dropbox.com/sh/8ycf32126zksot5/G90l0cW011 This shows the structure of how I implemented it. – user2905879 Oct 22 '13 at 08:48
  • I thing the first window not getting active after the second window was opened because the first window does not have tittle bar. To check add the tittle bar and try again. – Muruganandham K Oct 22 '13 at 08:58
  • But both my windows have title bar. I haven't unchecked Title bar for any. – user2905879 Oct 22 '13 at 09:08
  • OH you mean NSBorderlesswindowmask? I will try it. – user2905879 Oct 22 '13 at 09:18
  • But then the titlebar will appear . I want the whole window to be transparent. – user2905879 Oct 22 '13 at 09:23