2. Re: some newbie g_signal_connect questions



On Thursday August 21 2003 11:09 CEST, Gus Koppel wrote:
    
Matthias Mann wrote:

 but what's about callback functions? They don't need
 'return;'. Right?
    
Depends on the use of the callback function. Callback
handlers for some events (i.e. "delete_event"
    
Hi Gus!
    
That's new for me. I used this "delete-event" more then one
times for exiting a Gtk+ application. But i never needed the
gboolean return value. Is there any reason to take an action
by asking if return value is TRUE or FALSE? Or is this only
for the event handler that is created with g_signal_connect()?
    
 But if i have a function with 'return;' cause regular
 function calls it and also a callback function. Could this
 make problems for an application?
    
Not necessarily.
    
Thanx! This was that what i wanted to know. I could solve the
trouble.
    
 And by the way: a "void" function, does it need this
 'return;'? Or could i leave it generally?
    
It doesn't need it as its last statement. It's a matter of
coding style
    
Great! I was very confused. While finding out a solution for
some problems of my source code, i looked at sources of other
programmers and some had a 'return;' at end of callback
functions, others not. So i liked to know why.
    
Now my meaning is that it is better to have always a 'return;'
at end of all functions. I think this makes the source code
best readable and nobody needs to ask why this function has
no 'return;' while other functions have one.
    
best regards,
    
mathew
    
-- 
             ______________________________________________
                    get free software:  www.matman24.org
             ______________________________________________



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