diff options
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | display.h | 1 | ||||
-rw-r--r-- | info.c | 27 | ||||
-rw-r--r-- | main.c | 5 |
4 files changed, 36 insertions, 2 deletions
@@ -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 @@ -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); @@ -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; +} @@ -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); |