MCPcopy Create free account
hub / github.com/NetHack/NetHack / ghack_init_worn_window

Function ghack_init_worn_window

outdated/win/gnome/gnworn.c:35–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33void ghack_worn_display(GtkWidget *win, boolean block, gpointer data);
34
35GtkWidget *
36ghack_init_worn_window()
37{
38 GtkWidget *top;
39 GtkWidget *table;
40 GtkWidget *tablealign;
41 GtkWidget *label;
42 int i, j;
43
44 top = gtk_vbox_new(FALSE, 2);
45
46 table = gtk_table_new(WORN_HEIGHT, WORN_WIDTH, TRUE);
47 for (i = 0; i < WORN_HEIGHT; i++) {
48 for (j = 0; j < WORN_WIDTH; j++) {
49 worn_contents[i][j] =
50 gnome_pixmap_new_from_imlib(image_of_worn_object(NULL));
51 last_worn_objects[i][j] = NULL; /* a pointer that will never be */
52 gtk_table_attach(GTK_TABLE(table),
53 GTK_WIDGET(worn_contents[i][j]), j, j + 1, i,
54 i + 1, 0, 0, 0, 0);
55 }
56 }
57 tablealign = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
58 gtk_box_pack_start(GTK_BOX(top), tablealign, FALSE, FALSE, 0);
59 gtk_container_add(GTK_CONTAINER(tablealign), table);
60
61 label = gtk_label_new("Equipment");
62 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
63 gtk_box_pack_start(GTK_BOX(top), label, FALSE, FALSE, 0);
64
65 gtk_signal_connect(GTK_OBJECT(top), "ghack_display",
66 GTK_SIGNAL_FUNC(ghack_worn_display), NULL);
67
68 return top;
69}
70
71GdkImlibImage *
72image_of_worn_object(struct obj *o)

Callers 1

Calls 1

image_of_worn_objectFunction · 0.85

Tested by

no test coverage detected