comparison gtk/dw.c @ 407:a8124a9561c7

Fix for dw_window_set_text() on GTK 2.x.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 11 May 2003 06:10:14 +0000
parents 6a3ef130962f
children 1d7be77cbfb5
comparison
equal deleted inserted replaced
406:765ec42ee2e4 407:a8124a9561c7
2808 2808
2809 /* 2809 /*
2810 * Sets the text used for a given window. 2810 * Sets the text used for a given window.
2811 * Parameters: 2811 * Parameters:
2812 * handle: Handle to the window. 2812 * handle: Handle to the window.
2813 * text: The text associsated with a given window. 2813 * text: The text associsated with a given window. f
2814 */ 2814 */
2815 void dw_window_set_text(HWND handle, char *text) 2815 void dw_window_set_text(HWND handle, char *text)
2816 { 2816 {
2817 int _locked_by_me = FALSE; 2817 int _locked_by_me = FALSE;
2818 2818
2823 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(handle)->entry), text); 2823 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(handle)->entry), text);
2824 else if(GTK_IS_LABEL(handle)) 2824 else if(GTK_IS_LABEL(handle))
2825 gtk_label_set_text(GTK_LABEL(handle), text); 2825 gtk_label_set_text(GTK_LABEL(handle), text);
2826 else if(GTK_IS_BUTTON(handle)) 2826 else if(GTK_IS_BUTTON(handle))
2827 { 2827 {
2828 #if GTK_MAJOR_VERSION < 2
2828 GtkWidget *label = GTK_BUTTON(handle)->child; 2829 GtkWidget *label = GTK_BUTTON(handle)->child;
2829 2830
2830 if(GTK_IS_LABEL(label)) 2831 if(GTK_IS_LABEL(label))
2831 gtk_label_set_text(GTK_LABEL(label), text); 2832 gtk_label_set_text(GTK_LABEL(label), text);
2833 #else
2834 gtk_button_set_label(GTK_BUTTON(handle), text);
2835 #endif
2832 } 2836 }
2833 else if(GTK_IS_FRAME(handle)) 2837 else if(GTK_IS_FRAME(handle))
2834 { 2838 {
2835 GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label"); 2839 GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label");
2836 if(tmp && GTK_IS_LABEL(tmp)) 2840 if(tmp && GTK_IS_LABEL(tmp))