Quickie: Member function args

    The GtkEditable has some functions which use a pointer to a gint as an
"in/out" parameter, i.e.:

void       gtk_editable_insert_text   (GtkEditable       *editable,
                                        const gchar      *new_text,
                                        gint              new_text_length,
                                        gint             *position);

	Going in, *position is the desired position (a negative number
means end of the buffer) and coming out (after the function call)
*position is the actual position that was used.

	This seems weird to me.  It makes much more sense to just take a
normal gint, and then return a gint (or guint) instead of void.

	I'm writing a new text widget which cannot inherit from
GtkEditable.  I'm wondering if I should try to stay compatible with the
GtkEditable API (using the gint *) or if I should just write my own API
(and use gint).



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