Mercurial > pidgin
changeset 21407:dc5012153bfa
Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many
widgets you have added to a PidginMiniDialog.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Sun, 04 Nov 2007 23:58:50 +0000 |
parents | 7e07f5b271e5 |
children | 6225cd764a06 |
files | pidgin/minidialog.c pidgin/minidialog.h |
diffstat | 2 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/minidialog.c Sun Nov 04 23:57:43 2007 +0000 +++ b/pidgin/minidialog.c Sun Nov 04 23:58:50 2007 +0000 @@ -99,6 +99,12 @@ gpointer user_data; }; +guint +pidgin_mini_dialog_get_num_children(PidginMiniDialog *mini_dialog) +{ + return g_list_length(mini_dialog->contents->children); +} + static gboolean idle_destroy_cb(GtkWidget *mini_dialog) {
--- a/pidgin/minidialog.h Sun Nov 04 23:57:43 2007 +0000 +++ b/pidgin/minidialog.h Sun Nov 04 23:58:50 2007 +0000 @@ -151,6 +151,12 @@ const char *text, PidginMiniDialogCallback clicked_cb, gpointer user_data); +/** Gets the number of widgets packed into PidginMiniDialog.contents. + * @param mini_dialog a mini-dialog + * @return the number of widgets in @a mini_dialog->contents. + */ +guint pidgin_mini_dialog_get_num_children(PidginMiniDialog *mini_dialog); + G_END_DECLS #endif /* __PIDGIN_MINI_DIALOG_H__ */