Mercurial > dwindows
comparison gtk3/dw.c @ 1745:7dd1659c2693
Fixes for the new localization function on OS/2 and GTK3.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 04 Jun 2012 22:44:51 +0000 |
parents | 535e8c19a13d |
children | f297d8a63aed |
comparison
equal
deleted
inserted
replaced
1744:535e8c19a13d | 1745:7dd1659c2693 |
---|---|
5629 */ | 5629 */ |
5630 void API dw_filesystem_set_column_title(HWND handle, char *title) | 5630 void API dw_filesystem_set_column_title(HWND handle, char *title) |
5631 { | 5631 { |
5632 char *newtitle = strdup(title ? title : ""); | 5632 char *newtitle = strdup(title ? title : ""); |
5633 | 5633 |
5634 dw_window_set_data(handle, "_dw_coltitle", newtitle); | 5634 g_object_set_data(G_OBJECT(handle), "_dw_coltitle", newtitle); |
5635 } | 5635 } |
5636 | 5636 |
5637 /* | 5637 /* |
5638 * Sets up the filesystem columns, note: filesystem always has an icon/filename field. | 5638 * Sets up the filesystem columns, note: filesystem always has an icon/filename field. |
5639 * Parameters: | 5639 * Parameters: |
5644 */ | 5644 */ |
5645 int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count) | 5645 int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count) |
5646 { | 5646 { |
5647 char **newtitles = malloc(sizeof(char *) * (count + 1)); | 5647 char **newtitles = malloc(sizeof(char *) * (count + 1)); |
5648 unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 1)); | 5648 unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 1)); |
5649 char *coltitle = (char *)dw_window_get_data(handle, "_dw_coltitle"); | 5649 char *coltitle = (char *)g_object_get_data(G_OBJECT(handle), "_dw_coltitle"); |
5650 | 5650 |
5651 newtitles[0] = coltitle ? coltitle : "Filename"; | 5651 newtitles[0] = coltitle ? coltitle : "Filename"; |
5652 newflags[0] = DW_CFA_STRINGANDICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR; | 5652 newflags[0] = DW_CFA_STRINGANDICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR; |
5653 | 5653 |
5654 memcpy(&newtitles[1], titles, sizeof(char *) * count); | 5654 memcpy(&newtitles[1], titles, sizeof(char *) * count); |
5656 | 5656 |
5657 _dw_container_setup(handle, newflags, newtitles, count + 1, 1, 1); | 5657 _dw_container_setup(handle, newflags, newtitles, count + 1, 1, 1); |
5658 | 5658 |
5659 if(coltitle) | 5659 if(coltitle) |
5660 { | 5660 { |
5661 dw_window_set_data(handle, "_dw_coltitle", NULL); | 5661 g_object_set_data(G_OBJECT(handle), "_dw_coltitle", NULL); |
5662 free(coltitle); | 5662 free(coltitle); |
5663 } | 5663 } |
5664 if ( newtitles) free(newtitles); | 5664 if ( newtitles) free(newtitles); |
5665 if ( newflags ) free(newflags); | 5665 if ( newflags ) free(newflags); |
5666 return DW_ERROR_NONE; | 5666 return DW_ERROR_NONE; |