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

Function ghack_settings_dialog

outdated/win/gnome/gnopts.c:35–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void
36ghack_settings_dialog()
37{
38 int i;
39 static GtkWidget *dialog;
40 static GtkWidget *swin;
41 static GtkWidget *frame1;
42
43 dialog = gnome_dialog_new(_("GnomeHack Settings"), GNOME_STOCK_BUTTON_OK,
44 GNOME_STOCK_BUTTON_CANCEL, NULL);
45 gnome_dialog_close_hides(GNOME_DIALOG(dialog), FALSE);
46 gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
47 GTK_SIGNAL_FUNC(opt_sel_key_hit), tilesets);
48
49 frame1 = gtk_frame_new(_("Choose one of the following tilesets:"));
50 gtk_object_set_data(GTK_OBJECT(dialog), "frame1", frame1);
51 gtk_widget_show(frame1);
52 gtk_container_border_width(GTK_CONTAINER(frame1), 3);
53
54 swin = gtk_scrolled_window_new(NULL, NULL);
55 clist = gtk_clist_new(2);
56 gtk_clist_column_titles_hide(GTK_CLIST(clist));
57 gtk_widget_set_usize(GTK_WIDGET(clist), 100, 180);
58 gtk_container_add(GTK_CONTAINER(swin), clist);
59 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
60 GTK_POLICY_AUTOMATIC,
61 GTK_POLICY_AUTOMATIC);
62
63 gtk_signal_connect(GTK_OBJECT(clist), "select_row",
64 GTK_SIGNAL_FUNC(opt_sel_row_selected), NULL);
65
66 gtk_container_add(GTK_CONTAINER(frame1), swin);
67 gtk_box_pack_start_defaults(GTK_BOX(GNOME_DIALOG(dialog)->vbox), frame1);
68
69 /* Add the tilesets into the list here... */
70 for (i = 0; tilesets[i]; i++) {
71 gchar accelBuf[BUFSZ];
72 const char *text[3] = { accelBuf, tilesets[i], NULL };
73 sprintf(accelBuf, "%c ", tolower(tilesets[i][0]));
74 gtk_clist_insert(GTK_CLIST(clist), i, (char **) text);
75 }
76
77 gtk_clist_columns_autosize(GTK_CLIST(clist));
78 gtk_widget_show_all(swin);
79
80 /* Center the dialog over over parent */
81 gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
82 gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
83 gnome_dialog_set_parent(GNOME_DIALOG(dialog),
84 GTK_WINDOW(ghack_get_main_window()));
85
86 /* Run the dialog -- returning whichever button was pressed */
87 i = gnome_dialog_run(GNOME_DIALOG(dialog));
88 gnome_dialog_close(GNOME_DIALOG(dialog));
89
90 /* They hit Quit or error */
91 if (i != 0) {
92 return;

Callers 1

ghack_settings_cbFunction · 0.85

Calls 4

ghack_get_main_windowFunction · 0.85
ghack_free_glyphsFunction · 0.85
ghack_init_glyphsFunction · 0.85
ghack_reinit_map_windowFunction · 0.85

Tested by

no test coverage detected