Re: win32 port



But I use the same code as listed and got strange errors:

hello1.c(41) : error C2282: 'FAR' is followed by 'PASCAL' (missing ','?)
hello1.c(68) : error C2059: syntax error : '}'

Source code is as below
#include <gtk/gtk.h>

char *xargv[20];
int argc;

void hello(GtkWidget *widget, gpointer *data)
{
	g_print("Hello, world!");
}

void destroy(GtkWidget *widget, gpointer *data)
{
	gtk_main_quit();
}

int main(int argc, char *argv[])
{
	GtkWidget *window;
	GtkWidget *button;

	gtk_init(&argc, &argv);
	window=gtk_window_new(GTK_WINDOW_TOPLEVEL);

	gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(destroy), NULL);
	gtk_container_border_width(GTK_CONTAINER(window), 10);

	button=gtk_button_new_with_label("Hello, world!");
	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(hello), NULL);
	
	gtk_signal_connect_object(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window));
	gtk_container_add(GTK_CONTAINER(window), button);

	gtk_widget_show(button);
	gtk_widget_show(window);

	gtk_main();	
	return 0;
}

int FAR PASCAL WinMain(HINSTANCE hInst,HINSTANCE hPreInst, LPSTR lpszCmdLine, int nCmdShow)
 {
         int tmp;
         
         /* temporary */
         if (getenv("WINMODE") != (char *)0) {
                 if (strncmpi("WIN32",getenv("WINMODE"),5) == 0)
                         winmode = WINMODE_WIN32;
         }
         switch(winmode) {
 # ifndef WIN32S
                 case WINMODE_TTY:
                         strcpy(winstyle,"tty");
                         tmp = AllocConsole();
                         if (tmp) HaveConsole = 1;
                         break;
 # endif

                 case WINMODE_WIN32:
                         strcpy(winstyle,"win32");
                         break;
                 default:
                         strcpy(winstyle,DEFAULT_WINDOW_SYS);
                         break;
         }
         choose_windows(winstyle);
         return main(argc, xargv);
}
----------------------- Original Message -----------------------
 From:    Stephen Witkop <switk yahoo com>
 To:      watchthinker <watchthinker netease com>
 Cc:      "gtk-list gnome org" <gtk-list gnome org>
 Date:    02 Jul 2001 22:11:33 -0400
 Subject: Re: win32 port
----

On 03 Jul 2001 08:19:38 +0800, watchthinker wrote:
> I tried but it seemed doesn't work.
> 
> And I had not the gimp source code(it is too large to download). Is
> there anyone so kind to send me one copy of libgimp.h?
> 

You can look at the source file here:

http://cvs.gnome.org/lxr/source/gimp/libgimp/gimp.h

Stephen


--------------------- Original Message Ends --------------------






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]