 |
|
| Computers Forum Index » Computer Languages (Objective-C) » Objective-C development under Window platform... |
|
Page 1 of 1 |
|
| Author |
Message |
| Sam Hu... |
Posted: Mon Sep 21, 2009 6:20 am |
|
|
|
Guest
|
Greetings to everyone!
Maybe this is just a very silly question please forgive me anyway...
Can I code with ObjC under Windows platform,and/or making use of all
Cocoa's features? Is there any simple IDE that just support
coding ,editing,compiling,building and running such program?
Thanks for you help in advance.
Regards,
Sam |
|
|
| Back to top |
|
|
|
| Friedrich Dominicus... |
Posted: Mon Sep 21, 2009 2:16 pm |
|
|
|
Guest
|
Sam Hu <samhu.samhu at (no spam) gmail.com> writes:
Quote: Greetings to everyone!
Maybe this is just a very silly question please forgive me anyway...
Can I code with ObjC under Windows platform,
Yes.
Quote: and/or making use of all
Cocoa's features?
No, Cocoa is just Mac specific.
Quote: Is there any simple IDE that just support
coding ,editing,compiling,building and running such program?
Well the only thing which comes near an IDE is from GNUStep. Howerver
my experiences with it are very negative on Linux and so I bet it
won't be much better on Windows.
Regards
Friedrich
--
Please remove just-for-news- to reply via e-mail. |
|
|
| Back to top |
|
|
|
| Gary... |
Posted: Thu Oct 01, 2009 7:17 pm |
|
|
|
Guest
|
On Sep 21, 2:20 am, Sam Hu <samhu.sa... at (no spam) gmail.com> wrote:
Quote: Greetings to everyone!
Maybe this is just a very silly question please forgive me anyway...
Can I code with ObjC under Windows platform,and/or making use of all
Cocoa's features? Is there any simple IDE that just support
coding ,editing,compiling,building and running such program?
Thanks for you help in advance.
Regards,
Sam
How about something like this for Windows and Linux?
You can use any good editor as your IDE like Geany which runs on both
OSes.
Use GTK+ 2.x as your cross-platform GUI.
Use Glade as your GUI Builder and libGlade to implement the XML GUI
definition file --or-- if you would like to write your own GUI code
using an Objective-C gui lib... try something like this:
/**************************************************/
/******** Objective-C Wrapper for GTK+ 2.x ********/
/**************************************************/
/******** T E S T ********/
/**************************************************/
#import "og_interface.h"
/******** program section ********/
static void destroy(GtkWidget*, gpointer);
static void onclick_button2(GtkWidget*, gpointer);
int main (int argc, gchar *argv[])
{
// Define the GTK classes
ogWindow *myWindow;
ogHBox *myHBox;
ogButton *myButton1;
ogButton *myButton2;
// Must initialize GTK
ogINIT;
// Allocate and initialize the main window
myWindow = [[ogWindow alloc] initType: wtTOPLEVEL];
[myWindow setTitle: "Objective-C Wrapper for GTK+ 2.x"];
[myWindow setContainBorder: 25];
[myWindow setResize: FALSE];
[myWindow setWidth: 400 setHeight: 100];
[myWindow setPosition: wpCENTER];
// Define the event/signal for the main window
[myWindow evSignal: onDestroy Callback: destroy Parent: NULL];
// Allocate and initialize a horizontal box
myHBox = [[ogHBox alloc] initEqSpace: FALSE Spacing: 0];
[myHBox addContainer: [myWindow getID]];
// Allocate and initialize the 1st button
myButton1 = [[ogButton alloc] initMnemonic: "_Close"];
[myButton1 packStart: [myHBox getID] Expand: TRUE Fill: TRUE
Padding: 0];
// Define the event/signal for the 1st button
[myButton1 evSignal: onClick Callback: gtk_widget_destroy Parent:
[myWindow getID]];
// Allocate and initialize the 2nd button
myButton2 = [[ogButton alloc] initStock: siDLGINFO];
[myButton2 packStart: [myHBox getID] Expand: TRUE Fill: TRUE
Padding: 0];
// Define the event/signal for the 2nd button
[myButton2 evSignal: onClick Callback: onclick_button2 Parent:
[myWindow getID]];
// Show all widgets
[myWindow setShow: wsALL];
// Main GTK loop
ogLOOP;
// Sample MsgBox
MsgBox(NULL, mfPARENT, mtWARNING, mbCLOSE, "Goodbye World");
// Free all allocated classes
[myButton1 free];
[myButton2 free];
[myHBox free];
[myWindow free];
return 0;
}
/* Stop the GTK+ main loop function. */
static void destroy (GtkWidget *window, gpointer data)
{
// Quit GTK
ogQUIT;
}
static void onclick_button2(GtkWidget* window, gpointer data)
{
// Sample MsgBox
MsgBox(window, mfPARENT, mtINFO, mbCLOSE, "Hello World");
} |
|
|
| Back to top |
|
|
|
|
|
All times are GMT
The time now is Wed Dec 02, 2009 4:22 am
|
|