Gtker
Gtker

Reputation: 2267

How do I get rid of the console when writing GUI programs with gtk in C?

I'm following the tutorial:

http://zetcode.com/tutorials/gtktutorial/firstprograms/

It works but each time I double click on the executable,there is a console which I don't want it there.

How do I get rid of that console?

Platform: windows XP.

BTW I also have this trouble when right click on the icon:

GLib-WARNING **: g_main_context_check() called recursively from within a source's check() or prepare() member.

Is there anyone familiar with this?

Upvotes: 4

Views: 927

Answers (2)

Grim
Grim

Reputation: 318

The console opens then an application outputs text (which perhaps was obvious). By default the application outputs text then an error occurs. Use g_set_printerr_handler() change that behaviour (into displaying an error dialog, writing to a file or whatever you want).

Upvotes: -1

Matthew Talbert
Matthew Talbert

Reputation: 6048

When you link, use the argument -mwindows

gcc -o simple simple.c `pkg-config --libs --cflags gtk+-2.0` -mwindows

Upvotes: 5

Related Questions