gtk_widget_pop_composite_child();
+ hildon_caption_set_child_expand( caption, TRUE );
+
gtk_widget_show_all( priv->caption_area );
}
* @Returns : a #GtkWidget pointer of Caption
*/
GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
- GtkWidget *control, GtkWidget *icon,
+ GtkWidget *child, GtkWidget *icon,
HildonCaptionStatus flag)
{
GtkWidget *widget;
- g_return_val_if_fail( GTK_IS_WIDGET(control), NULL );
+ g_return_val_if_fail( GTK_IS_WIDGET(child), NULL );
widget = g_object_new( HILDON_TYPE_CAPTION, "label", value,
- "size_group", group, "icon", icon, "status", flag,
+ "child" /* From GtkContainer */, child, "size_group", group, "icon", icon, "status", flag,
NULL );
- /* Pack the captioned widget */
- hildon_caption_set_child_expand( HILDON_CAPTION(widget), TRUE );
- gtk_container_add( GTK_CONTAINER(widget), control );
-
-
return widget;
}
#include <hildon-widgets/hildon-grid.h>
#include <hildon-widgets/hildon-time-editor.h>
#include <hildon-widgets/hildon-name-password-dialog.h>
+#include <hildon-widgets/hildon-caption.h>
#include <outo.h>
/* Icon which must exist (HildonGridItem). */
#ifndef HILDON_DISABLE_DEPRECATED
int test41a(void);
#endif
+
+int test42 (void);
+
/* this has to be like this (not static). outo
calls for this! */
testcase *get_tests(void);
return 1;
}
+int test42 ()
+{
+ GtkWidget *entry, *caption;
+
+ entry = gtk_entry_new ();
+ caption = hildon_caption_new (NULL /* group */,
+ "caption text",
+ GTK_WIDGET(entry), NULL,
+ HILDON_CAPTION_OPTIONAL /* flag */);
+
+ g_assert (caption);
+ return 1;
+}
+
testcase tcases[] =
{
{*test1a, "hildon_controlbar_new", EXPECT_OK},
{*test39b, "namepassword dialog get_password", EXPECT_OK},
/* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
{*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
-
+
+ { test42, "hildon_caption_new", EXPECT_OK },
+
{0} /*REMEMBER THE TERMINATING NULL*/
};