/[cabestan]/widgets.c
ViewVC logotype

Contents of /widgets.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7 - (show annotations)
Mon Oct 5 19:15:42 2009 UTC (8 years, 2 months ago) by ben
File MIME type: text/plain
File size: 1715 byte(s)
variable speed step forward/backward
1 /* -------------------------------
2 * | |
3 * | 23:01:02.00000000 |
4 * | |
5 * |=================||-----------
6 * | PL | PA | ST | FF | FR | .. |
7 * |____|____|____|____|____|____|
8 *
9 */
10 #include <gtk/gtk.h>
11 #include <glib.h>
12 #include "cabestan.h"
13
14 GtkWidget* window_create(const gchar* title) {
15 GtkWidget* window;
16
17 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
18 gtk_window_set_title(GTK_WINDOW(window), title);
19 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
20 return window;
21
22 }
23
24 GtkWidget* button_create(const gchar* stock_id) {
25 GtkWidget* button = NULL;
26 GtkWidget* image = NULL;
27
28 button = gtk_button_new();
29 image = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_BUTTON);
30 gtk_button_set_image(GTK_BUTTON(button), image);
31 return button;
32 }
33
34 GtkWidget* timeline_create(void) {
35 GtkWidget* timeline = NULL;
36 gchar* markup = NULL;
37
38 timeline = gtk_label_new("");
39 gtk_label_set_justify(GTK_LABEL(timeline), GTK_JUSTIFY_CENTER);
40 markup = format_time (0.0);
41 gtk_label_set_markup(GTK_LABEL (timeline), markup);
42 g_free(markup);
43 return timeline;
44 }
45
46 GtkWidget* vbox_create (void) {
47 return gtk_vbox_new (TRUE, 0);
48 }
49
50 void window_add_vbox(GtkWidget* window, GtkWidget* vbox) {
51 gtk_container_add(GTK_CONTAINER(window), vbox);
52 }
53
54 void vbox_pack_widget(GtkWidget* vbox, GtkWidget* widget) {
55 gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, FALSE, 0);
56 return;
57 }
58
59 GtkWidget* hbox_create() {
60 return gtk_hbox_new(TRUE, 0);
61 }
62
63 void hbox_pack_widget(GtkWidget* hbox, GtkWidget* widget) {
64 gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, FALSE, 0);
65 return;
66 }
67
68 GtkWidget* frame_check_create () {
69 return gtk_check_button_new_with_label("frame");
70 }

  ViewVC Help
Powered by ViewVC 1.1.26