summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--display.h1
-rw-r--r--info.c27
-rw-r--r--main.c5
4 files changed, 36 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 41058147c..5bb40c217 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
CC=gcc
CFLAGS=-Wall -Wno-pointer-sign -g
-OBJS=main.o profile.o divelist.o parse.o
+OBJS=main.o profile.o info.o divelist.o parse.o
parse: $(OBJS)
$(CC) $(LDLAGS) -o parse $(OBJS) `xml2-config --libs` \
@@ -16,5 +16,8 @@ main.o: main.c dive.h display.h
profile.o: profile.c dive.h display.h
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` -c profile.c
+info.o: info.c dive.h display.h
+ $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` -c info.c
+
divelist.o: divelist.c dive.h display.h
$(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` -c divelist.c
diff --git a/display.h b/display.h
index 8a8b42634..327997f05 100644
--- a/display.h
+++ b/display.h
@@ -7,6 +7,7 @@
extern int selected_dive;
extern GtkWidget *dive_profile_frame(void);
+extern GtkWidget *dive_info_frame(void);
extern GtkWidget *create_dive_list(void);
extern void repaint_dive(void);
diff --git a/info.c b/info.c
new file mode 100644
index 000000000..05bcf0f78
--- /dev/null
+++ b/info.c
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "dive.h"
+#include "display.h"
+
+GtkWidget *dive_info_frame(void)
+{
+ GtkWidget *frame;
+ GtkWidget *hbox;
+ GtkWidget *depth;
+
+ frame = gtk_frame_new("Dive info");
+ gtk_widget_show(frame);
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_container_add(GTK_CONTAINER(frame), hbox);
+
+ depth = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(depth), "54 ft");
+ gtk_editable_set_editable(GTK_EDITABLE(depth), FALSE);
+
+ gtk_box_pack_start(GTK_BOX(hbox), depth, FALSE, FALSE, 0);
+
+ return frame;
+}
diff --git a/main.c b/main.c
index 2df31c4d2..d3853faab 100644
--- a/main.c
+++ b/main.c
@@ -94,9 +94,12 @@ int main(int argc, char **argv)
/* Frame for dive profile */
frame = dive_profile_frame();
gtk_table_attach_defaults(GTK_TABLE(table), frame, 1, 2, 1, 2);
-
dive_profile = frame;
+ /* Frame for dive info */
+ frame = dive_info_frame();
+ gtk_table_attach_defaults(GTK_TABLE(table), frame, 1, 2, 0, 1);
+
gtk_widget_set_app_paintable(win, TRUE);
gtk_widget_show_all(win);