* BUG: GTK+ callbacks must return a gboolean, not a bool. The C++ compiler
  does not compile the same thing in both cases!


git-svn-id: svn://localhost/gambas/trunk@4565 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2012-03-19 02:19:06 +00:00
parent da79fa86de
commit d278346779
6 changed files with 14 additions and 15 deletions

View file

@ -81,7 +81,7 @@ static void cb_click_check(GtkButton *object, gButton *data)
}
static bool button_expose(GtkWidget *wid,GdkEventExpose *e,gButton *data)
static gboolean button_expose(GtkWidget *wid,GdkEventExpose *e,gButton *data)
{
GdkGC *gc;
GdkPixbuf *img;

View file

@ -71,7 +71,7 @@ static void cb_end(GtkPrintOperation *operation, GtkPrintContext *context, gPrin
(*printer->onEnd)(printer);
}
static bool cb_paginate(GtkPrintOperation *operation, GtkPrintContext *context, gPrinter *printer)
static gboolean cb_paginate(GtkPrintOperation *operation, GtkPrintContext *context, gPrinter *printer)
{
#if DEBUG_ME
fprintf(stderr, "cb_paginate\n");

View file

@ -78,7 +78,7 @@ static void cb_size_allocate(GtkWidget *wid, GtkAllocation *alloc, gTabStrip *da
}
}
static bool cb_button_expose(GtkWidget *wid, GdkEventExpose *e, gTabStrip *data)
static gboolean cb_button_expose(GtkWidget *wid, GdkEventExpose *e, gTabStrip *data)
{
GdkGC *gc;
GdkPixbuf *img;

View file

@ -152,7 +152,7 @@ gTrayIcon
**************************************************************************/
static bool tray_enterleave(GtkWidget *widget, GdkEventCrossing *e,gTrayIcon *data)
static gboolean tray_enterleave(GtkWidget *widget, GdkEventCrossing *e,gTrayIcon *data)
{
if (gApplication::loopLevel() > data->loopLevel()) return false;
if (e->type==GDK_ENTER_NOTIFY)

View file

@ -748,11 +748,11 @@ void gTree::clear()
while ((key = firstRow()))
removeRow(key);
for (int i = 0; i < columnCount(); i++)
/*for (int i = 0; i < columnCount(); i++)
{
setColumnWidth(i, 16);
setColumnWidth(i, -1);
}
}*/
unlock();
}
@ -986,6 +986,8 @@ gTreeRow* gTree::addRow(char *key, char *parent, char *after, bool before)
else
piter = NULL;
fprintf(stderr, "[0]: %d %d\n", columnResizable(0), gtk_tree_view_column_get_sizing(gt_tree_view_find_column(GTK_TREE_VIEW(widget), 0)));
if (aft)
{
if (before)
@ -1003,6 +1005,8 @@ gTreeRow* gTree::addRow(char *key, char *parent, char *after, bool before)
g_hash_table_insert(datakey, (gpointer)buf, (gpointer)row);
gtk_tree_store_set(store, &iter, view ? 0 : 1, buf, -1);
fprintf(stderr, "[0]: -> %d %d\n", columnResizable(0), gtk_tree_view_column_get_sizing(gt_tree_view_find_column(GTK_TREE_VIEW(widget), 0)));
if (parent)
{
getRow(parent)->setExpanded();
@ -1089,8 +1093,8 @@ void gTree::addColumn()
gtk_tree_view_column_set_cell_data_func(column,rgraph,(GtkTreeCellDataFunc)tree_cell_graph,(gpointer)this,NULL);
gtk_tree_view_column_set_cell_data_func(column,rtext,(GtkTreeCellDataFunc)tree_cell_text,(gpointer)this,NULL);
gtk_tree_view_column_set_resizable(column, isResizable());
gtk_tree_view_column_set_sizing(column, isAutoResize() ? GTK_TREE_VIEW_COLUMN_AUTOSIZE : GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_resizable(column, isResizable());
gtk_tree_view_append_column(GTK_TREE_VIEW(widget),column);
g_signal_connect(G_OBJECT(column), "clicked", G_CALLBACK(cb_column_clicked), (gpointer)this);

View file

@ -45,16 +45,11 @@ static void cb_select(GtkTreeSelection *selection, gTreeView *control)
control->emit(SIGNAL(control->onSelect));
}
static void cb_click(GtkWidget *widget, gTreeView *control)
{
//control->emit(SIGNAL(control->onClick));
}
static bool cb_button_press(GtkWidget *widget, GdkEventButton *e, gTreeView *control)
static gboolean cb_button_press(GtkWidget *widget, GdkEventButton *e, gTreeView *control)
{
char *key;
if (e->type == GDK_BUTTON_PRESS)
if (e->type == GDK_BUTTON_PRESS && e->window == gtk_tree_view_get_bin_window(GTK_TREE_VIEW(control->widget)))
{
key = control->find((int)e->x, (int)e->y);
@ -152,7 +147,7 @@ gTreeView::gTreeView(gContainer *parent, bool list) : gControl(parent)
g_signal_connect(G_OBJECT(sel),"changed",G_CALLBACK(cb_select),(gpointer)this);
g_signal_connect(G_OBJECT(treeview),"row-expanded",G_CALLBACK(cb_expand),(gpointer)this);
g_signal_connect(G_OBJECT(treeview),"row-collapsed",G_CALLBACK(cb_collapse),(gpointer)this);
g_signal_connect(G_OBJECT(treeview),"cursor-changed",G_CALLBACK(cb_click),(gpointer)this);
//g_signal_connect(G_OBJECT(treeview),"cursor-changed",G_CALLBACK(cb_click),(gpointer)this);
g_signal_connect_after(G_OBJECT(treeview), "expose-event", G_CALLBACK(cb_expose), (gpointer)this);
}