aboutsummaryrefslogtreecommitdiffstats
path: root/char-table.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-06-06 20:39:36 +0200
committerMattias Andrée <m@maandree.se>2026-06-06 20:39:36 +0200
commite61c74dba5dd3cd2a3e48aa1fc7ff2658e5cb6e1 (patch)
treeed75883a7c2527e2adc395b5e20c06d00632a5b7 /char-table.c
parentSecond commit (diff)
downloadgcmap-e61c74dba5dd3cd2a3e48aa1fc7ff2658e5cb6e1.tar.gz
gcmap-e61c74dba5dd3cd2a3e48aa1fc7ff2658e5cb6e1.tar.bz2
gcmap-e61c74dba5dd3cd2a3e48aa1fc7ff2658e5cb6e1.tar.xz
misc
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--char-table.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/char-table.c b/char-table.c
new file mode 100644
index 0000000..da82544
--- /dev/null
+++ b/char-table.c
@@ -0,0 +1,44 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+G_DEFINE_TYPE(CharTable, gcmap_char_table, GTK_TYPE_DRAWING_AREA)
+
+
+static gboolean
+gcmap_char_table_expose(GtkWidget *widget, GdkEventExpose *event)
+{
+ cairo_t *cr = gdk_cairo_create(widget->window);
+
+ (void) event;
+
+ cairo_set_source_rgb(cr, 0.2f, 0.2f, 0.2f);
+ cairo_paint(cr);
+
+ cairo_set_source_rgb(cr, 1.0f, 1.0f, 1.0f);
+ cairo_move_to(cr, 10, 20);
+ cairo_show_text(cr, "Hello GTK+ 2");
+
+ cairo_destroy(cr);
+ return FALSE;
+}
+
+static void
+gcmap_char_table_init(CharTable *self)
+{
+ gtk_widget_set_size_request(GTK_WIDGET(self), 200, 100);
+}
+
+
+static void
+gcmap_char_table_class_init(CharTableClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ widget_class->expose_event = gcmap_char_table_expose;
+}
+
+
+GtkWidget *
+gcmap_char_table_new(void)
+{
+ return g_object_new(GCMAP_TYPE_CHAR_TABLE, NULL);
+}