Re: gtk+ in Windows with VC6



On Mon, 31 Jul 2000, Wolfgang Sourdeau wrote:

Hello,

> > 	I use gcc in Windows 2000 to compile my GTK+ app, and I believe
> > that even in that set up one gets the pop-up console (though I'm not sure
> > because I haven't compiled the program in windows for a while).  You might
> > want to try mailing the GTK+ win32 mailing list (see http://www.gtk.org
> > for a link to the GTK+ Win32 page) since Tor (I think that's his name) has
> > compiled gimp, and that doesn't have a pop-up window.
> > 
> > Sincerely,
> > Caleb Land
> > (bokonon@rochester.rr.com)
> 
> There are three things to be done to avoid that console when compiiling
> with gcc.
> 
> 1) use the -mwindows flag with gcc;
> 2) don't use printf and related

This two points are true. However using printf itself will not open new
console. But using g_printf on WIN32 contains code for openning new
console window using AllocConsole.

When you are using VC6 GUI, you must have your project as "Win32 
application" not "Win32 Console Application".

> 3) avoid errors; otherwise the lib's printfs and related will get
> used. 

This can be workaround. You can replace default glib handler for handling log
messages with your own which will do something else than print the
messages to console. For example for disabling Gdk messages use

g_log_set_handler("Gdk", G_LOG_LEVEL_MASK, your_log_handler, posibily_yor_data_or_NULL);

Inside function  your_log_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...)
you can do something with the messages. For example you can throw there
all messages or log it to file instead to console.

Best regards,
Stevo.

-- 
Stefan Ondrejicka <ondrej@idata.sk>
Beethovenova 11, 917 08 Trnava, Slovakia
http://www.idata.sk/~ondrej/





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