Mercurial > dwindows
comparison dwtest.c @ 1525:34ce887be578
Handle special case of overlay scrollbars returning size 0.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 02 Jan 2012 00:20:17 +0000 |
parents | 9b24233d7606 |
children | 2fd9ff675d79 |
comparison
equal
deleted
inserted
replaced
1524:010e1d916ee7 | 1525:34ce887be578 |
---|---|
978 vscrollbar = dw_scrollbar_new(DW_VERT, 50); | 978 vscrollbar = dw_scrollbar_new(DW_VERT, 50); |
979 hscrollbar = dw_scrollbar_new(DW_HORZ, 50); | 979 hscrollbar = dw_scrollbar_new(DW_HORZ, 50); |
980 dw_window_get_preferred_size(vscrollbar, &vscrollbarwidth, NULL); | 980 dw_window_get_preferred_size(vscrollbar, &vscrollbarwidth, NULL); |
981 dw_window_get_preferred_size(hscrollbar, NULL, &hscrollbarheight); | 981 dw_window_get_preferred_size(hscrollbar, NULL, &hscrollbarheight); |
982 | 982 |
983 /* On GTK with overlay scrollbars enabled this returns us 0... | |
984 * so in that case we need to give it some real values. | |
985 */ | |
986 if(!vscrollbarwidth) | |
987 vscrollbarwidth = 8; | |
988 if(!hscrollbarheight) | |
989 hscrollbarheight = 8; | |
990 | |
983 /* create render box for number pixmap */ | 991 /* create render box for number pixmap */ |
984 textbox1 = dw_render_new( 100 ); | 992 textbox1 = dw_render_new( 100 ); |
985 dw_window_set_font(textbox1, FIXEDFONT); | 993 dw_window_set_font(textbox1, FIXEDFONT); |
986 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height); | 994 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height); |
987 font_width = font_width / 2; | 995 font_width = font_width / 2; |