Libxfce4ui api review

Nick Schermer nickschermer at gmail.com
Tue Jul 7 17:48:52 CEST 2009


2009/7/7 Brian J. Tarricone <brian at tarricone.org>:
>>> 8.  I don't really understand what xfce_gtk_dialog_parse_parent() does
>>> based
>>> on the API description.  Can you explain it better?  Also I very much
>>> dislike how 'parent' can be a GtkWidget or GdkScreen -- ohhhh, I see why
>>> the
>>> xfce_message_dialog*() functions take a gpointer now.  Every time I think
>>> about doing something like that for *private* internal API, I cringe and
>>> try
>>> to find a better way.  Absolutely we shouldn't do something like this for
>>> *public* API.
>>
>> Ok, will remove it.
>
> Can you explain what those functions are for exactly?  I'm curious... If
> they're useful, we should keep them, but maybe make the API a little less
> weird.

Mm after updating the git panel to the new api, I'd still like to
reconsider this. I'll explain:

There are a couple of cases there you just want to show an error
dialog without having a transient widget (for example a plugin that
failed to start). you can simply do this:

xfce_dialog_show_error (gtk_widget_get_screen (GTK_WIDGET (plugin)), .....);

or when you show an error on a button action that failed:

xfce_dialog_show_error (button, ....) instead of
xfce_dialog_show_error (GTK_WINDOW (gtk_widget_get_toplevel (button)),
...)

or you simply set a GtkWindow as parent. The last get_toplevel thing
is more convenient, but for the GdkScreen case you now pass NULL which
might result in a dialog showing up at the wrong location.

Nick



More information about the Xfce4-dev mailing list