]> git.scottworley.com Git - batteryviewer/blob - chart.c
Start on chart GTK widget
[batteryviewer] / chart.c
1 /*
2 * h/t https://ptomato.name/advanced-gtk-techniques/html/custom-container.html
3 * for examples of how to make GTK widgets
4 */
5
6 #include "chart.h"
7 #include <gtk/gtk.h>
8
9 #define BV_CHART_PRIVATE(obj) \
10 (G_TYPE_INSTANCE_GET_PRIVATE((obj), BV_CHART_TYPE, BVChartPrivate))
11
12 typedef struct _BVChartPrivate BVChartPrivate;
13
14 struct _BVChartPrivate {
15 int temp;
16 };
17
18 G_DEFINE_TYPE_WITH_CODE(BVChart, bv_chart, GTK_TYPE_DRAWING_AREA,
19 G_ADD_PRIVATE(BVChart))
20
21 static void bv_chart_class_init(BVChartClass *klass __attribute__((unused))) {}
22
23 static void bv_chart_init(BVChart *chart) {
24 gtk_widget_set_has_window(GTK_WIDGET(chart), FALSE);
25 }
26
27 GtkWidget *bv_chart_new() {
28 return GTK_WIDGET(g_object_new(bv_chart_get_type(), NULL));
29 }