Re: WWW interface functions in Gnome libraries?




On Tue, 19 May 1998, Graham Hughes wrote:
> 
> Oh, granted :-).
>

Cool. My main point was just to use gnome-preferences instead of your own
mechanism. Of course, that means you have to go in libgnomeui and not
libgnome (don't ask me the difference between the two. :)
 
> True.  Hmm..., this is sticky.  I'll do the dialog for now; maybe an
> error callback can be made part of the interface at some later date.  I
> don't like the function itself returning an error code, because it's
> intended to be a convenience thing; if you really cared about what was
> happening, you'd probably grab the data yourself and use the
> gnome-mime.h stuff.
>

I like that. You just have to do gnome_error_dialog(_("Couldn't load
browser")); - easy enough to take out later, no trouble to put in now.
 
> Works; the reason I did it the other way is that some people have
> objections to any functions returning a malloced string to you; they
> are why strdup is still considered questionable in some circles.  OTOH,
> if glib does things this way there's no reason to be different, and
> g_strconcat certainly implies that the current style leans toward
> malloc()ing on my own.
>

Yeah, there are tons of Gnome/glib/Gtk functions that return malloced
stuff. Just be sure there's a clear comment in the header saying "free
this" so people know.
 
> I was figuring return -1 and set some errno, but then I realized that's
> a very stdio-ish way of doing things, and may not be appropriate; what
> is the usual Gnome manner?
>

Um, uhhh... ;-) 

There is basically no usual Gnome manner. The Gnome libraries are much
more chaotic than Gtk, since there are so many authors and no Master
Plan... as long as you put in a nice comment explaining what you mean,
copying stdio is probably as good a thing as any.

Havoc





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