[maemo-commits] [maemo-commits] r13262 - in projects/haf/trunk/hildon-1: . examples
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Thu Aug 16 16:03:11 EEST 2007
- Previous message: [maemo-commits] r13261 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r13263 - in projects/haf/trunk/hildon-1: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: mdk Date: 2007-08-16 16:03:08 +0300 (Thu, 16 Aug 2007) New Revision: 13262 Added: projects/haf/trunk/hildon-1/examples/hildon-toolbar-seekbar-example.c Modified: projects/haf/trunk/hildon-1/ChangeLog projects/haf/trunk/hildon-1/examples/Makefile.am Log: Adding an example to test a HildonSeekbar widget inside a toolbar. Modified: projects/haf/trunk/hildon-1/ChangeLog =================================================================== --- projects/haf/trunk/hildon-1/ChangeLog 2007-08-16 12:46:16 UTC (rev 13261) +++ projects/haf/trunk/hildon-1/ChangeLog 2007-08-16 13:03:08 UTC (rev 13262) @@ -1,3 +1,9 @@ +2007-08-16 Michael Dominic Kostrzewa <michael.kostrzewa at nokia.com> + + * examples/Makefile.am: + * examples/hildon-toolbar-seekbar-example.c: Adding an example to test a + HildonSeekbar widget inside a toolbar. + 2007-08-16 Xan Lopez <xan.lopez at nokia.com> * src/hildon-banner.c (hildon_banner_init): mark the banners as Modified: projects/haf/trunk/hildon-1/examples/Makefile.am =================================================================== --- projects/haf/trunk/hildon-1/examples/Makefile.am 2007-08-16 12:46:16 UTC (rev 13261) +++ projects/haf/trunk/hildon-1/examples/Makefile.am 2007-08-16 13:03:08 UTC (rev 13262) @@ -36,7 +36,8 @@ hildon-seekbar-example \ hildon-find-toolbar-example \ hildon-wizard-dialog-example \ - hildon-hvolumebar-timer-example + hildon-hvolumebar-timer-example \ + hildon-toolbar-seekbar-example # Hildon window hildon_window_example_LDADD = $(HILDON_OBJ_LIBS) @@ -58,6 +59,11 @@ hildon_seekbar_example_CFLAGS = $(HILDON_OBJ_CFLAGS) hildon_seekbar_example_SOURCES = hildon-seekbar-example.c +# Hildon toolbar seekbar +hildon_toolbar_seekbar_example_LDADD = $(HILDON_OBJ_LIBS) +hildon_toolbar_seekbar_example_CFLAGS = $(HILDON_OBJ_CFLAGS) +hildon_toolbar_seekbar_example_SOURCES = hildon-toolbar-seekbar-example.c + # Hildon finger hildon_finger_example_LDADD = $(HILDON_OBJ_LIBS) hildon_finger_example_CFLAGS = $(HILDON_OBJ_CFLAGS) Added: projects/haf/trunk/hildon-1/examples/hildon-toolbar-seekbar-example.c =================================================================== --- projects/haf/trunk/hildon-1/examples/hildon-toolbar-seekbar-example.c 2007-08-16 12:46:16 UTC (rev 13261) +++ projects/haf/trunk/hildon-1/examples/hildon-toolbar-seekbar-example.c 2007-08-16 13:03:08 UTC (rev 13262) @@ -0,0 +1,65 @@ +/* + * This file is a part of hildon examples + * + * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. + * + * Author: Michael Dominic Kostrzewa <michael.kostrzewa at nokia.com> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <glib.h> +#include <gtk/gtk.h> +#include "hildon.h" + +int +main (int argc, + char **args) +{ + gtk_init (&argc, &args); + + HildonProgram *program = hildon_program_get_instance (); + + GtkWidget *window = hildon_window_new (); + hildon_program_add_window (program, HILDON_WINDOW (window)); + + gtk_init (&argc, &args); + + HildonSeekbar *bar = HILDON_SEEKBAR (hildon_seekbar_new ()); + gtk_widget_set_size_request (GTK_WIDGET (bar), 400, -1); + + hildon_seekbar_set_total_time (bar, 100); + hildon_seekbar_set_position (bar, 50); + + GtkToolbar *toolbar = gtk_toolbar_new (); + GtkToolItem *item = gtk_tool_item_new (); + gtk_container_add (GTK_CONTAINER (item), GTK_WIDGET (bar)); + gtk_toolbar_insert (toolbar, item , 0); + + hildon_window_add_toolbar (window, toolbar); + + g_signal_connect (G_OBJECT (window), "delete_event", G_CALLBACK (gtk_main_quit), NULL); + gtk_widget_show_all (GTK_WIDGET (window)); + + gtk_main (); + + return 0; +} + +
- Previous message: [maemo-commits] r13261 - projects/haf/hafbuildbot
- Next message: [maemo-commits] r13263 - in projects/haf/trunk/hildon-1: . src
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]