changeset 1321:7630404386be

Fixed setting font on comboboxes for GTK2... Several other widgets still don't work like listbox and spinbutton... Not sure if it is even possible... both these work on GTK3. Also initial commit of container flag to do string comparisons instead of pointer for Mark.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 06 Nov 2011 11:48:24 +0000
parents 6bebcfa03b2b
children 3f1ac800bf65
files gtk/dw.c
diffstat 1 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Sun Nov 06 10:39:57 2011 +0000
+++ b/gtk/dw.c	Sun Nov 06 11:48:24 2011 +0000
@@ -2965,12 +2965,19 @@
       if(tmp)
          handle2 = tmp;
    }
-   else if(GTK_IS_COMBO_BOX(handle) || GTK_IS_BUTTON(handle))
+   else if(GTK_IS_BUTTON(handle))
    {
       GtkWidget *tmp = gtk_bin_get_child(GTK_BIN(handle));
       if(tmp)
          handle2 = tmp;
    }
+   else if(GTK_IS_COMBO(handle))
+   {
+      GtkWidget *tmp = GTK_COMBO(handle)->entry;
+      if(tmp)
+         handle2 = tmp;
+   }
+
 
 #if GTK_MAJOR_VERSION < 2
    /* Free old font if it exists */
@@ -7540,7 +7547,7 @@
 {
    int _locked_by_me = FALSE;
    GtkWidget *clist;
-   int rowcount, z;
+   int rowcount, z, textcomp;
    char *rowdata;
 
    DW_MUTEX_LOCK;
@@ -7551,12 +7558,13 @@
       DW_MUTEX_UNLOCK;
       return;
    }
+   textcomp = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_textcomp"));
    rowcount = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"));
 
    for(z=0;z<rowcount;z++)
    {
       rowdata = gtk_clist_get_row_data(GTK_CLIST(clist), z);
-      if ( rowdata == text )
+      if ( (textcomp && rowdata && strcmp(rowdata, text) == 0) || rowdata == text )
       {
          gfloat pos;
          GtkAdjustment *adj = gtk_clist_get_vadjustment(GTK_CLIST(clist));
@@ -7585,7 +7593,7 @@
 {
    int _locked_by_me = FALSE;
    GtkWidget *clist;
-   int rowcount, z;
+   int rowcount, z, textcomp;
    char *rowdata;
 
    DW_MUTEX_LOCK;
@@ -7596,12 +7604,13 @@
       DW_MUTEX_UNLOCK;
       return;
    }
+   textcomp = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(handle), "_dw_textcomp"));
    rowcount = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"));
 
    for(z=0;z<rowcount;z++)
    {
       rowdata = gtk_clist_get_row_data(GTK_CLIST(clist), z);
-      if ( rowdata == text )
+      if ( (textcomp && rowdata && strcmp(rowdata, text) == 0) || rowdata == text )
       {
          _dw_unselect(clist);