# HG changeset patch # User Will Thompson # Date 1194220730 0 # Node ID dc5012153bfa83b979759d988f1624f41ce4ad98 # Parent 7e07f5b271e554cc796675af75553b6e5ba12c8c Add pidgin_mini_dialog_get_num_children(), a convenient way to check how many widgets you have added to a PidginMiniDialog. diff -r 7e07f5b271e5 -r dc5012153bfa pidgin/minidialog.c --- 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) { diff -r 7e07f5b271e5 -r dc5012153bfa pidgin/minidialog.h --- 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__ */