Click here to Skip to main content
12,406,528 members (31,886 online)
   

C#

 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc25-Feb-13 3:12
membertaibc25-Feb-13 3:12 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
Pete O'Hanlon25-Feb-13 4:43
protectorPete O'Hanlon25-Feb-13 4:43 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc25-Feb-13 4:53
membertaibc25-Feb-13 4:53 
AnswerRe: The .exe application file isn't obfuscated after installing setup ? Pin
Samer AlRawi26-Feb-13 17:41
memberSamer AlRawi26-Feb-13 17:41 
GeneralRe: The .exe application file isn't obfuscated after installing setup ? Pin
taibc28-Feb-13 14:36
membertaibc28-Feb-13 14:36 
QuestionC# Pin
MohanKrishna.Kota24-Feb-13 4:06
memberMohanKrishna.Kota24-Feb-13 4:06 
AnswerASP.NET Pin
Jegan Thiyagesan25-Feb-13 12:14
memberJegan Thiyagesan25-Feb-13 12:14 
General[TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Jake Rieger23-Feb-13 14:36
memberJake Rieger23-Feb-13 14:36 
I thought I would show you guys a quick tutorial on how to build native cocoa apps using C# and MonoMac. I will be showing you how to make the famous "Hello World" app.

Lets Begin!

You will need the following:
MonoDevelop IDE
MonoDevelop Framework SDK
XCode 4.x

One you have those, open up MonoDevelop. Click on "new solution" Drop down the C# category and select "Mac (open source)" and create a MonoMac project.

Now once that is done you should have some files and folders. Double click the MainWindow.xib file and XCode should open. Add a button and a label. Now click the middle button above Editor in the top right of XCode. Find "Automatic" and click on it and go to "MainWindowController.h" Now right click and drag the button to the code and add an outlet called "guiButton" or whatever you want. Do the same with the label. Now right click and drag from the button again but this time select action and name it "buttonClicked."

Ok, that's done. Save and close XCode. Now go back to MonoDevelop and open MainWindow.designer. A bunch of new code should have been added. Verify that the outlets and action have been added before continuing.
Your file should look like this:

// WARNING
//
// This file has been generated automatically by MonoDevelop to store outlets and
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoMac.Foundation;
 
namespace dontgivemeerrors
{
	[Register ("MainWindowController")]
	partial class MainWindowController
	{
		[Outlet]
		MonoMac.AppKit.NSTextField guiTextField { get; set; }
 
		[Outlet]
		MonoMac.AppKit.NSButton guiButton { get; set; }
 
		[Action ("buttonClicked:")]
		partial void buttonClicked (MonoMac.Foundation.NSObject sender);
		
		void ReleaseDesignerOutlets ()
		{
			if (guiTextField != null) {
				guiTextField.Dispose ();
				guiTextField = null;
			}
 
			if (guiButton != null) {
				guiButton.Dispose ();
				guiButton = null;
			}
		}
	}
 
	[Register ("MainWindow")]
	partial class MainWindow
	{
		
		void ReleaseDesignerOutlets ()
		{
		}
	}
}

Ok, now open MainWindowController.cs and find "#endregion" Go under it and add the following line of code:

partial void buttonClicked (MonoMac.Foundation.NSObject sender)
{
 
}

Replace "buttonClicked" with name of your action. Now for the final step. Add this to that line of code:

partial void buttonClicked (MonoMac.Foundation.NSObject sender)
{
     this.guiLabel.StringValue = "Hello World";
}

Now run the app by pressing the icon with 2 gears and a green gear on the top right of MonoDevelop. Press the button and the label text should change to "Hello World."

Thats it. Most of your code will be under the action void. To find your .app file, go to YourUserName -> Projects -> NameOfProject -> NameOfProject -> bin -> Debug

Happy Coding! Smile | :)

- Team HsM
HSM

GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Dave Kreskowiak23-Feb-13 14:39
mvpDave Kreskowiak23-Feb-13 14:39 
GeneralRe: [TUTORIAL] Native Cocoa Apps with C# and MonoMac Pin
Mycroft Holmes24-Feb-13 18:17
memberMycroft Holmes24-Feb-13 18:17 
Questionprograme Pin
ongwere23-Feb-13 9:35
memberongwere23-Feb-13 9:35 
AnswerRe: programe PinPopular
SoMad23-Feb-13 10:37
memberSoMad23-Feb-13 10:37 
GeneralRe: programe Pin
Manfred R. Bihy23-Feb-13 11:37
memberManfred R. Bihy23-Feb-13 11:37 
GeneralRe: programe Pin
SoMad23-Feb-13 11:46
memberSoMad23-Feb-13 11:46 
AnswerRe: programe Pin
Amir Mohammad Nasrollahi29-Jul-13 21:45
professionalAmir Mohammad Nasrollahi29-Jul-13 21:45 
QuestionCustomize windows scroll bar in combobox Pin
Kaizen20223-Feb-13 7:45
memberKaizen20223-Feb-13 7:45 
AnswerRe: Customize windows scroll bar in combobox Pin
SledgeHammer0123-Feb-13 9:20
memberSledgeHammer0123-Feb-13 9:20 
GeneralRe: Customize windows scroll bar in combobox Pin
Kaizen20224-Feb-13 6:01
memberKaizen20224-Feb-13 6:01 
GeneralRe: Customize windows scroll bar in combobox Pin
SledgeHammer0124-Feb-13 8:20
memberSledgeHammer0124-Feb-13 8:20 
Questionunable to start program, unrecognized error in windows web services framework Pin
bonosa23-Feb-13 5:06
memberbonosa23-Feb-13 5:06 
Questionwhy System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 1:54
memberJassim Rahma23-Feb-13 1:54 
AnswerRe: why System.NullReferenceException occurred? Pin
Alan N23-Feb-13 2:04
memberAlan N23-Feb-13 2:04 
GeneralRe: why System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 2:10
memberJassim Rahma23-Feb-13 2:10 
GeneralRe: why System.NullReferenceException occurred? Pin
Alan N23-Feb-13 2:33
memberAlan N23-Feb-13 2:33 
GeneralRe: why System.NullReferenceException occurred? Pin
Jassim Rahma23-Feb-13 2:44
memberJassim Rahma23-Feb-13 2:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160730.1 | Last Updated 30 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid