GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Nov 28, 2014 1:21 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: No command shell, please.
PostPosted: Thu Sep 29, 2005 2:07 am 
Offline
Familiar Face

Joined: Thu Sep 22, 2005 12:23 pm
Posts: 20
I have just installed gtkmm and I have compiled my first program, I don't know if this happens in UNIX, but in MS-Win there is always a command shell window that pops up just before the application starts, how can I change that?

TIA

_________________
* You cannot exercise your power to a point of humiliation.
- Jean Chretien

* It's amazing how the small seeds of distrust and misunderstanding
can yield a crop of hate and death...

Ma'assalama! Adiós! bye!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 12:34 pm 
Offline
Familiar Face

Joined: Wed Sep 21, 2005 1:43 pm
Posts: 12
I don't know if this will help, because I don't use GTKmm.
However, I've noticed those DOS boxes pop up when using GTK with other languages.
I believe that GTK is trying to report a warning message, so the DOS box is opened,
but for some reason, no error text appears.
Most often this seems to be caused by missing fonts, perhaps other errors could cause similar problems.

Regards,
Irv


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 3:10 pm 
Offline
Familiar Face

Joined: Wed Sep 21, 2005 4:14 am
Posts: 17
Location: Aachen, Germany
To forcefully repress any console-message of gtk-apps you have to do something like this (preferablely in your main.cpp):

Code:
void dummy_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
{
    return;
}


Then in your initialization code in main.cpp add a new log-handler for every message you want to repress. Here is a bunch that disables the most common ones afaik:

Code:
    g_log_set_handler (NULL,
                       (GLogLevelFlags) (G_LOG_LEVEL_ERROR |
                                         G_LOG_LEVEL_CRITICAL |
                                         G_LOG_LEVEL_WARNING |
                                         G_LOG_LEVEL_MESSAGE |
                                         G_LOG_LEVEL_INFO |
                                         G_LOG_LEVEL_DEBUG |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("Gdk",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("Gtk",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("GLib",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("GLib-GObject",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("GModule",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);

    g_log_set_handler ("GThread",
                       (GLogLevelFlags) (G_LOG_LEVEL_MASK |
                                         G_LOG_FLAG_FATAL |
                                         G_LOG_FLAG_RECURSION),
                       dummy_handler,
                       NULL);


I hope that helps.

Best regards...

MacSlow

_________________
First they ignore you...
then they laugh at you...
then they fight you...
then you win!
(Gandhi)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group