Mercurial > dwindows
comparison gtk/dw.c @ 33:72675de7d229
Renamed slider class to percent class. Implemented my own percent widget
on OS/2 to avoid horrible memory leak.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 30 Aug 2001 06:07:19 +0000 |
parents | b1d7e8a28dfa |
children | b03b24bb95f8 |
comparison
equal
deleted
inserted
replaced
32:f3bf96c2786d | 33:72675de7d229 |
---|---|
1747 DW_MUTEX_UNLOCK; | 1747 DW_MUTEX_UNLOCK; |
1748 return tmp; | 1748 return tmp; |
1749 } | 1749 } |
1750 | 1750 |
1751 /* | 1751 /* |
1752 * Create a new slider window (widget) to be packed. | 1752 * Create a new percent bar window (widget) to be packed. |
1753 * Parameters: | 1753 * Parameters: |
1754 * id: An ID to be used with WinWindowFromID() or 0L. | 1754 * id: An ID to be used with WinWindowFromID() or 0L. |
1755 */ | 1755 */ |
1756 HWND dw_slider_new(unsigned long id) | 1756 HWND dw_percent_new(unsigned long id) |
1757 { | 1757 { |
1758 GtkWidget *tmp; | 1758 GtkWidget *tmp; |
1759 int _locked_by_me = FALSE; | 1759 int _locked_by_me = FALSE; |
1760 | 1760 |
1761 DW_MUTEX_LOCK; | 1761 DW_MUTEX_LOCK; |
2296 } | 2296 } |
2297 DW_MUTEX_UNLOCK; | 2297 DW_MUTEX_UNLOCK; |
2298 } | 2298 } |
2299 | 2299 |
2300 /* | 2300 /* |
2301 * Returns the range of the slider. | 2301 * Returns the range of the percent bar. |
2302 * Parameters: | 2302 * Parameters: |
2303 * handle: Handle to the slider to be queried. | 2303 * handle: Handle to the slider to be queried. |
2304 */ | 2304 */ |
2305 unsigned int dw_slider_query_range(HWND handle) | 2305 unsigned int dw_percent_query_range(HWND handle) |
2306 { | 2306 { |
2307 return 100; | 2307 return 100; |
2308 } | 2308 } |
2309 | 2309 |
2310 /* | 2310 /* |
2311 * Sets the slider position. | 2311 * Sets the percent bar position. |
2312 * Parameters: | 2312 * Parameters: |
2313 * handle: Handle to the slider to be set. | 2313 * handle: Handle to the slider to be set. |
2314 * position: Position of the slider withing the range. | 2314 * position: Position of the slider withing the range. |
2315 */ | 2315 */ |
2316 void dw_slider_set_pos(HWND handle, unsigned int position) | 2316 void dw_percent_set_pos(HWND handle, unsigned int position) |
2317 { | 2317 { |
2318 int _locked_by_me = FALSE; | 2318 int _locked_by_me = FALSE; |
2319 | 2319 |
2320 DW_MUTEX_LOCK; | 2320 DW_MUTEX_LOCK; |
2321 gtk_progress_bar_update(GTK_PROGRESS_BAR(handle), (gfloat)position/100); | 2321 gtk_progress_bar_update(GTK_PROGRESS_BAR(handle), (gfloat)position/100); |