summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
87b8df3)
* hildon-lgpl/hildon-caption.c:
(hildon_caption_init): Do the hildon_caption_set_child_expand()
here.
(hildon_caption_new): Use the child property from GtkContainer
instead of calling gtk_container_add(), because _new() functions
should just use g_object_new(), so that language-bindings can do
the same.
* ut/hildon-widgets_tests.c: Added test42 for hildon_caption_new.
gtk_widget_pop_composite_child();
gtk_widget_pop_composite_child();
+ hildon_caption_set_child_expand( caption, TRUE );
+
gtk_widget_show_all( priv->caption_area );
}
gtk_widget_show_all( priv->caption_area );
}
* @Returns : a #GtkWidget pointer of Caption
*/
GtkWidget *hildon_caption_new( GtkSizeGroup *group, const gchar *value,
* @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;
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,
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,
- /* Pack the captioned widget */
- hildon_caption_set_child_expand( HILDON_CAPTION(widget), TRUE );
- gtk_container_add( GTK_CONTAINER(widget), control );
-
-
#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-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). */
#include <outo.h>
/* Icon which must exist (HildonGridItem). */
#ifndef HILDON_DISABLE_DEPRECATED
int test41a(void);
#endif
#ifndef HILDON_DISABLE_DEPRECATED
int test41a(void);
#endif
/* this has to be like this (not static). outo
calls for this! */
testcase *get_tests(void);
/* this has to be like this (not static). outo
calls for this! */
testcase *get_tests(void);
+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},
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},*/
{*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*/
};
{0} /*REMEMBER THE TERMINATING NULL*/
};