A couple of compiler warning fixes, GtkCList signal changes, changed

fileselect to work with new CList signals, and enhanced testgtk's clist
example to show pixmaps and signal results. -Jay Painter
This commit is contained in:
Jay Painter
1998-02-18 10:03:54 +00:00
parent 7e3692b99f
commit 9ad922290c
15 changed files with 438 additions and 156 deletions

View File

@ -1659,21 +1659,38 @@ hide_titles_clist (GtkWidget *widget, gpointer data)
gtk_clist_column_titles_hide (GTK_CLIST (data));
}
void
mouse_click_clist (GtkWidget *widget,
gint row,
gint column,
gint button)
{
g_print ("GtkCList Mouse Click: row %d column %d button %d\n",
row, column, button);
}
void
mouse_double_click_clist (GtkWidget *widget,
gint row,
gint column,
gint button)
{
g_print ("GtkCList Mouse Double Click: row %d column %d button %d\n",
row, column, button);
}
void
select_clist (GtkWidget *widget,
gint row,
gint column,
GdkEventButton *bevent)
gint button)
{
gint button = 0, i;
gint i;
guint8 spacing;
gchar *text;
GdkPixmap *pixmap;
GdkBitmap *mask;
if (bevent)
button = bevent->button;
g_print ("GtkCList Selection: row %d column %d button %d\n",
row, column, button);
@ -1713,6 +1730,55 @@ select_clist (GtkWidget *widget,
clist_selected_row = row;
}
void
unselect_clist (GtkWidget *widget,
gint row,
gint column,
gint button)
{
gint i;
guint8 spacing;
gchar *text;
GdkPixmap *pixmap;
GdkBitmap *mask;
g_print ("GtkCList UnSelection: row %d column %d button %d\n",
row, column, button);
for (i = 0; i < TESTGTK_CLIST_COLUMNS; i++)
{
switch (gtk_clist_get_cell_type (GTK_CLIST (widget), row, i))
{
case GTK_CELL_TEXT:
g_print ("CELL %d GTK_CELL_TEXT\n", i);
gtk_clist_get_text (GTK_CLIST (widget), row, i, &text);
g_print ("TEXT: %s\n", text);
break;
case GTK_CELL_PIXMAP:
g_print ("CELL %d GTK_CELL_PIXMAP\n", i);
gtk_clist_get_pixmap (GTK_CLIST (widget), row, i, &pixmap, &mask);
g_print ("PIXMAP: %d\n", (int) pixmap);
g_print ("MASK: %d\n", (int) mask);
break;
case GTK_CELL_PIXTEXT:
g_print ("CELL %d GTK_CELL_PIXTEXT\n", i);
gtk_clist_get_pixtext (GTK_CLIST (widget), row, i, &text, &spacing, &pixmap, &mask);
g_print ("TEXT: %s\n", text);
g_print ("SPACING: %d\n", spacing);
g_print ("PIXMAP: %d\n", (int) pixmap);
g_print ("MASK: %d\n", (int) mask);
break;
default:
break;
}
}
g_print ("\n\n");
}
void
list_selection_clist (GtkWidget *widget, gpointer data)
{
@ -1852,17 +1918,24 @@ create_clist ()
/*
* the rest of the clist configuration
*/
/*
gtk_clist_set_column_title (GTK_CLIST (clist), 0, "Hello");
gtk_clist_set_column_title (GTK_CLIST (clist), 4, "Joe 4");
*/
gtk_clist_column_titles_passive (GTK_CLIST (clist));
gtk_clist_set_row_height (GTK_CLIST (clist), 20);
gtk_signal_connect (GTK_OBJECT (clist),
"mouse_click",
(GtkSignalFunc) mouse_click_clist,
NULL);
gtk_signal_connect (GTK_OBJECT (clist),
"mouse_double_click",
(GtkSignalFunc) mouse_double_click_clist,
NULL);
gtk_signal_connect (GTK_OBJECT (clist),
"select_row",
(GtkSignalFunc) select_clist,
NULL);
gtk_signal_connect (GTK_OBJECT (clist),
"unselect_row",
(GtkSignalFunc) unselect_clist,
NULL);
gtk_clist_set_column_width (GTK_CLIST (clist), 0, 100);