[Mono-osx] Make a window without titlebar and border

Virginijus mrgutis at gmail.com
Fri Aug 19 04:40:46 EDT 2011


You must create other constructor and in Initialize do not set style mask:

//removes style from window

 [Export("initWithContentRect:styleMask:backing:defer:")]

 public MainWindow (RectangleF rect, NSWindowStyle style, NSBackingStore
backing, bool defer) :

 base(rect, NSWindowStyle.Borderless, backing, defer)

 {

 Initialize ();

 }

On Thu, Aug 18, 2011 at 5:53 PM, De Santis Luca <farolfo at hotmail.com> wrote:

>  Hi, I'm try make a window without border and title bar with Monomac. I've
> read a this thread on stackoverflow:
>
> http://stackoverflow.com/questions/2018147/hide-nswindow-title-bar
>
> I created a simple project with MonoDevelop and I tried to set the value of
> StyleMask property like the thread on stackoverflow, but it dosen't work.
> Someone can help me with this problem ?
>
> Thank you
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using MonoMac.Foundation;
> using MonoMac.AppKit;
>
> namespace QuickTime.Mac.VideoPlayer
> {
> public partial class MainWindow : MonoMac.AppKit.NSWindow
> {
> #region Constructors
>
> // Called when created from unmanaged code
> public MainWindow (IntPtr handle) : base(handle)
> {
> Initialize ();
> }
>
> // Called when created directly from a XIB file
> [Export("initWithCoder:")]
> public MainWindow (NSCoder coder) : base(coder)
> {
> Initialize ();
> }
>
> // Shared initialization code
> void Initialize ()
> {
> this.StyleMask=NSWindowStyle.Borderless;
> }
>  #endregion
> }
> }
>
> Sorry for my bad english and if question is stupid but I use Mono only with
> GTK and Winform and I don't know Cocoa very well
>
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110819/d98491e9/attachment-0001.html 


More information about the Mono-osx mailing list