comparison dwtest.c @ 2252:5dbe950115c1

Mac: Fix crash in dw_window_set_font() with NULL font name. Not sure if I am getting the default font correctly, may need to revisit. Also switched Helv to Helvetica so it works on Mac, might need an #ifdef if this doesn't work on other platforms.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 24 Jan 2021 23:17:02 +0000
parents 4fb54b9fcf78
children 08369a79850f
comparison
equal deleted inserted replaced
2251:15347d28995a 2252:5dbe950115c1
1386 dw_checkbox_set(checkbox, TRUE); 1386 dw_checkbox_set(checkbox, TRUE);
1387 text = dw_text_new("Font:", 0); 1387 text = dw_text_new("Font:", 0);
1388 dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER); 1388 dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
1389 dw_box_pack_start(hbox, text, -1, -1, FALSE, TRUE, 1); 1389 dw_box_pack_start(hbox, text, -1, -1, FALSE, TRUE, 1);
1390 fontsize = dw_spinbutton_new("9", 0); 1390 fontsize = dw_spinbutton_new("9", 0);
1391 dw_box_pack_start(hbox, fontsize, 50, -1, TRUE, FALSE, 1); 1391 dw_box_pack_start(hbox, fontsize, 50, -1, FALSE, FALSE, 1);
1392 dw_spinbutton_set_limits(fontsize, 100, 5); 1392 dw_spinbutton_set_limits(fontsize, 100, 5);
1393 fontname = dw_combobox_new("Default", 0); 1393 fontname = dw_combobox_new("Default", 0);
1394 dw_listbox_append(fontname, "Default"); 1394 dw_listbox_append(fontname, "Default");
1395 dw_listbox_append(fontname, "Helv"); 1395 dw_listbox_append(fontname, "Helvetica");
1396 dw_listbox_append(fontname, "Arial"); 1396 dw_listbox_append(fontname, "Arial");
1397 dw_box_pack_start(hbox, fontname, 150, -1, TRUE, FALSE, 1); 1397 dw_box_pack_start(hbox, fontname, 150, -1, TRUE, FALSE, 1);
1398 dw_box_pack_start(notebookbox4, hbox, -1, -1, TRUE, FALSE, 1); 1398 dw_box_pack_start(notebookbox4, hbox, -1, -1, TRUE, FALSE, 1);
1399 1399
1400 dw_window_set_data(hbox, "mlefore", DW_POINTER(mlefore)); 1400 dw_window_set_data(hbox, "mlefore", DW_POINTER(mlefore));