GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

No command shell, please.

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
Jamiil
Familiar Face


Joined: 22 Sep 2005
Posts: 20

PostPosted: Thu Sep 29, 2005 2:07 am    Post subject: No command shell, please. Reply with quote

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
Back to top
irvm
Familiar Face


Joined: 21 Sep 2005
Posts: 12

PostPosted: Thu Sep 29, 2005 12:34 pm    Post subject: Reply with quote

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
Back to top
MacSlow
Familiar Face


Joined: 21 Sep 2005
Posts: 17
Location: Aachen, Germany

PostPosted: Thu Sep 29, 2005 3:10 pm    Post subject: Reply with quote

To forcefully repress any console-message of gtk-apps you have to do something like this (preferablely in your main.cpp):

Code: (Plaintext)
1
2
3
4
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: (Plaintext)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

    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
Back to top
Amy606
Familiar Face


Joined: 23 Dec 2005
Posts: 5

PostPosted: Tue Dec 27, 2005 4:04 am    Post subject: Oh, C'mon Reply with quote

Judging from what you've wrote here, I don't think you understand anything about it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP