Commit 479e39f6 authored by Manish Singh's avatar Manish Singh

autoconfed for random/lrand48/rand madness dbbrowser uses clist now,

* autoconfed for random/lrand48/rand madness
* dbbrowser uses clist now, thanks to msw
* gfig.c: minor fix for buggy compilers
* plasma.c, snoise.c: applied gimp-kmt-980321-[0,1]
* tiff.c: minor fix

-Yosh
parent cbae3b5c
......@@ -39,6 +39,9 @@
#undef RETSIGTYPE
#undef TIME_WITH_SYS_TIME
#undef RAND_FUNC
#undef SRAND_FUNC
/* #undef PACKAGE */
/* #undef VERSION */
......
......@@ -27,9 +27,6 @@
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
#undef HAVE_DIRENT_H
#undef HAVE_DOPRNT
#undef HAVE_IPC_H
......@@ -50,6 +47,9 @@
#undef RETSIGTYPE
#undef TIME_WITH_SYS_TIME
#undef RAND_FUNC
#undef SRAND_FUNC
/* #undef PACKAGE */
/* #undef VERSION */
......
......@@ -215,6 +215,13 @@ fi
dnl TVM: check for compiler characteristics
AC_C_INLINE
dnl Check for random number functions
AC_CHECK_FUNC(random,
AC_DEFINE(RAND_FUNC, random) AC_DEFINE(SRAND_FUNC, srandom),
AC_CHECK_FUNC(lrand48,
AC_DEFINE(RAND_FUNC, lrand48) AC_DEFINE(SRAND_FUNC, srand48),
AC_DEFINE(RAND_FUNC, rand) AC_DEFINE(SRAND_FUNC, srand)))
CFLAGS="$gimp_save_CFLAGS"
LIBS="$gimp_save_LIBS"
......
......@@ -47,7 +47,6 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
GtkWidget *button;
GtkWidget *hbox,*searchhbox,*vbox;
GtkWidget *label;
GtkWidget *list_scroll;
dbbrowser = (gpointer)malloc(sizeof(dbbrowser_t));
......@@ -80,22 +79,16 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* list : list in a scrolled_win */
list_scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
dbbrowser->clist = gtk_clist_new(1);
gtk_clist_set_selection_mode (GTK_CLIST (dbbrowser->clist),
GTK_SELECTION_BROWSE);
gtk_widget_set_usize(dbbrowser->clist, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_signal_connect (GTK_OBJECT (dbbrowser->clist), "select_row",
(GtkSignalFunc) procedure_select_callback,
dbbrowser);
gtk_box_pack_start (GTK_BOX (vbox),
list_scroll, TRUE, TRUE, 0);
gtk_widget_set_usize(list_scroll, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_widget_show(list_scroll);
dbbrowser->list = gtk_list_new();
gtk_list_set_selection_mode (GTK_LIST (dbbrowser->list),
GTK_SELECTION_BROWSE);
gtk_signal_connect (GTK_OBJECT (dbbrowser->list), "button_press_event",
(GtkSignalFunc) dialog_list_button, dbbrowser);
gtk_container_add (GTK_CONTAINER (list_scroll), dbbrowser->list);
gtk_widget_show(dbbrowser->list);
dbbrowser->clist, TRUE, TRUE, 0);
gtk_widget_show(dbbrowser->clist);
/* search entry */
......@@ -168,7 +161,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* now build the list */
gtk_widget_show (dbbrowser->list);
gtk_widget_show (dbbrowser->clist);
gtk_widget_show (dbbrowser->dlg);
/* initialize the "return" value (for "apply") */
......@@ -195,39 +188,27 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
static gint
dialog_list_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
procedure_select_callback (GtkWidget *widget,
gint row,
gint column,
GdkEventButton * bevent,
gpointer data)
{
gchar *text, *temp;
dbbrowser_t *dbbrowser = data;
GtkWidget *event_widget;
gchar *proc_name;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
// g_return_val_if_fail (bevent != NULL, FALSE);
g_return_val_if_fail (dbbrowser != NULL, FALSE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
if (GTK_IS_LIST_ITEM (event_widget))
{
switch (event->type)
{
case GDK_BUTTON_PRESS:
proc_name = gtk_object_get_user_data (GTK_OBJECT (event_widget));
/* gtk_widget_grab_focus (fs->selection_entry); */
dialog_select (dbbrowser, proc_name);
break;
case GDK_2BUTTON_PRESS:
if (dbbrowser->apply_callback) {}
/* gtk_button_clicked (GTK_BUTTON (fs->ok_button)); */
break;
default:
break;
}
}
if (gtk_clist_get_text (GTK_CLIST (widget), row, column, &temp)) {
text = g_strdup(temp);
unconvert_string(text);
dialog_select (dbbrowser, text);
g_free(text);
}
return FALSE;
}
......@@ -456,7 +437,7 @@ dialog_select (dbbrowser_t *dbbrowser,
gtk_widget_show(label);
row++;
/* TODO
/*
label = gtk_label_new("Help :");
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (dbbrowser->descr_table), label,
......@@ -464,8 +445,7 @@ dialog_select (dbbrowser_t *dbbrowser,
GTK_FILL, GTK_FILL, 3, 0);
gtk_widget_show(label);
insert help here
but gtk_text seems bugggggggyyy */
TODO: Add help */
if (old_table) gtk_widget_destroy(old_table);
......@@ -480,7 +460,7 @@ dialog_close_callback (GtkWidget *widget,
/* end of the dialog */
{
dbbrowser_t* dbbrowser = data;
if (dbbrowser->apply_callback) {
/* we are called by another application : just kill the dialog box */
gtk_widget_hide(dbbrowser->dlg);
......@@ -514,16 +494,6 @@ dialog_apply_callback (GtkWidget *widget,
}
static void
dialog_selection_free_filename (GtkWidget *widget,
gpointer client_data)
{
g_return_if_fail (widget != NULL);
g_free (gtk_object_get_user_data (GTK_OBJECT (widget)));
gtk_object_set_user_data (GTK_OBJECT (widget), NULL);
}
static void
dialog_search_callback (GtkWidget *widget,
gpointer data)
......@@ -532,11 +502,9 @@ dialog_search_callback (GtkWidget *widget,
char **proc_list;
int num_procs;
dbbrowser_t* dbbrowser = data;
GList *procs_list = NULL;
if (GTK_LIST(dbbrowser->list)->children)
gtk_list_remove_items( GTK_LIST(dbbrowser->list),
GTK_LIST(dbbrowser->list)->children);
gtk_clist_freeze(GTK_CLIST(dbbrowser->clist));
gtk_clist_clear(GTK_CLIST(dbbrowser->clist));
/* search */
......@@ -565,14 +533,12 @@ dialog_search_callback (GtkWidget *widget,
}
if (num_procs != 0) {
GtkWidget* list_item;
gchar *insert_name, *label_name;
int i,j,savej;
for (i = 0; i < num_procs ; i++) {
/* sort the list step by step */
insert_name=g_strdup(proc_list[0]); savej=0;
for (j = 0; j < num_procs ; j++) {
if (strcmp(proc_list[j],insert_name)<0) {
......@@ -586,12 +552,7 @@ dialog_search_callback (GtkWidget *widget,
label_name = g_strdup( insert_name );
convert_string( label_name );
list_item = gtk_list_item_new_with_label ( label_name );
gtk_object_set_user_data (GTK_OBJECT (list_item), insert_name );
gtk_widget_show ( list_item );
procs_list = g_list_append (procs_list, list_item );
gtk_clist_append (GTK_CLIST (dbbrowser->clist), &label_name);
if (i==0) dialog_select( dbbrowser , insert_name );
......@@ -599,20 +560,15 @@ dialog_search_callback (GtkWidget *widget,
}
}
if ( dbbrowser->list ) {
gtk_container_foreach (GTK_CONTAINER (dbbrowser->list),
dialog_selection_free_filename, NULL);
gtk_list_clear_items (GTK_LIST (dbbrowser->list), 0, -1);
if (procs_list)
gtk_list_append_items (GTK_LIST (dbbrowser->list),
procs_list);
if ( dbbrowser->clist ) {
;
}
g_free( proc_list );
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg),
"DB Browser");
gtk_clist_thaw(GTK_CLIST(dbbrowser->clist));
}
......@@ -628,6 +584,16 @@ convert_string (char *str)
}
}
static void
unconvert_string (char *str)
{
while (*str)
{
if (*str == '-') *str = '_';
str++;
}
}
static char*
GParamType2char(GParamType t)
{
......
......@@ -47,7 +47,6 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
GtkWidget *button;
GtkWidget *hbox,*searchhbox,*vbox;
GtkWidget *label;
GtkWidget *list_scroll;
dbbrowser = (gpointer)malloc(sizeof(dbbrowser_t));
......@@ -80,22 +79,16 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* list : list in a scrolled_win */
list_scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
dbbrowser->clist = gtk_clist_new(1);
gtk_clist_set_selection_mode (GTK_CLIST (dbbrowser->clist),
GTK_SELECTION_BROWSE);
gtk_widget_set_usize(dbbrowser->clist, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_signal_connect (GTK_OBJECT (dbbrowser->clist), "select_row",
(GtkSignalFunc) procedure_select_callback,
dbbrowser);
gtk_box_pack_start (GTK_BOX (vbox),
list_scroll, TRUE, TRUE, 0);
gtk_widget_set_usize(list_scroll, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_widget_show(list_scroll);
dbbrowser->list = gtk_list_new();
gtk_list_set_selection_mode (GTK_LIST (dbbrowser->list),
GTK_SELECTION_BROWSE);
gtk_signal_connect (GTK_OBJECT (dbbrowser->list), "button_press_event",
(GtkSignalFunc) dialog_list_button, dbbrowser);
gtk_container_add (GTK_CONTAINER (list_scroll), dbbrowser->list);
gtk_widget_show(dbbrowser->list);
dbbrowser->clist, TRUE, TRUE, 0);
gtk_widget_show(dbbrowser->clist);
/* search entry */
......@@ -168,7 +161,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* now build the list */
gtk_widget_show (dbbrowser->list);
gtk_widget_show (dbbrowser->clist);
gtk_widget_show (dbbrowser->dlg);
/* initialize the "return" value (for "apply") */
......@@ -195,39 +188,27 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
static gint
dialog_list_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
procedure_select_callback (GtkWidget *widget,
gint row,
gint column,
GdkEventButton * bevent,
gpointer data)
{
gchar *text, *temp;
dbbrowser_t *dbbrowser = data;
GtkWidget *event_widget;
gchar *proc_name;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
// g_return_val_if_fail (bevent != NULL, FALSE);
g_return_val_if_fail (dbbrowser != NULL, FALSE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
if (GTK_IS_LIST_ITEM (event_widget))
{
switch (event->type)
{
case GDK_BUTTON_PRESS:
proc_name = gtk_object_get_user_data (GTK_OBJECT (event_widget));
/* gtk_widget_grab_focus (fs->selection_entry); */
dialog_select (dbbrowser, proc_name);
break;
case GDK_2BUTTON_PRESS:
if (dbbrowser->apply_callback) {}
/* gtk_button_clicked (GTK_BUTTON (fs->ok_button)); */
break;
default:
break;
}
}
if (gtk_clist_get_text (GTK_CLIST (widget), row, column, &temp)) {
text = g_strdup(temp);
unconvert_string(text);
dialog_select (dbbrowser, text);
g_free(text);
}
return FALSE;
}
......@@ -456,7 +437,7 @@ dialog_select (dbbrowser_t *dbbrowser,
gtk_widget_show(label);
row++;
/* TODO
/*
label = gtk_label_new("Help :");
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (dbbrowser->descr_table), label,
......@@ -464,8 +445,7 @@ dialog_select (dbbrowser_t *dbbrowser,
GTK_FILL, GTK_FILL, 3, 0);
gtk_widget_show(label);
insert help here
but gtk_text seems bugggggggyyy */
TODO: Add help */
if (old_table) gtk_widget_destroy(old_table);
......@@ -480,7 +460,7 @@ dialog_close_callback (GtkWidget *widget,
/* end of the dialog */
{
dbbrowser_t* dbbrowser = data;
if (dbbrowser->apply_callback) {
/* we are called by another application : just kill the dialog box */
gtk_widget_hide(dbbrowser->dlg);
......@@ -514,16 +494,6 @@ dialog_apply_callback (GtkWidget *widget,
}
static void
dialog_selection_free_filename (GtkWidget *widget,
gpointer client_data)
{
g_return_if_fail (widget != NULL);
g_free (gtk_object_get_user_data (GTK_OBJECT (widget)));
gtk_object_set_user_data (GTK_OBJECT (widget), NULL);
}
static void
dialog_search_callback (GtkWidget *widget,
gpointer data)
......@@ -532,11 +502,9 @@ dialog_search_callback (GtkWidget *widget,
char **proc_list;
int num_procs;
dbbrowser_t* dbbrowser = data;
GList *procs_list = NULL;
if (GTK_LIST(dbbrowser->list)->children)
gtk_list_remove_items( GTK_LIST(dbbrowser->list),
GTK_LIST(dbbrowser->list)->children);
gtk_clist_freeze(GTK_CLIST(dbbrowser->clist));
gtk_clist_clear(GTK_CLIST(dbbrowser->clist));
/* search */
......@@ -565,14 +533,12 @@ dialog_search_callback (GtkWidget *widget,
}
if (num_procs != 0) {
GtkWidget* list_item;
gchar *insert_name, *label_name;
int i,j,savej;
for (i = 0; i < num_procs ; i++) {
/* sort the list step by step */
insert_name=g_strdup(proc_list[0]); savej=0;
for (j = 0; j < num_procs ; j++) {
if (strcmp(proc_list[j],insert_name)<0) {
......@@ -586,12 +552,7 @@ dialog_search_callback (GtkWidget *widget,
label_name = g_strdup( insert_name );
convert_string( label_name );
list_item = gtk_list_item_new_with_label ( label_name );
gtk_object_set_user_data (GTK_OBJECT (list_item), insert_name );
gtk_widget_show ( list_item );
procs_list = g_list_append (procs_list, list_item );
gtk_clist_append (GTK_CLIST (dbbrowser->clist), &label_name);
if (i==0) dialog_select( dbbrowser , insert_name );
......@@ -599,20 +560,15 @@ dialog_search_callback (GtkWidget *widget,
}
}
if ( dbbrowser->list ) {
gtk_container_foreach (GTK_CONTAINER (dbbrowser->list),
dialog_selection_free_filename, NULL);
gtk_list_clear_items (GTK_LIST (dbbrowser->list), 0, -1);
if (procs_list)
gtk_list_append_items (GTK_LIST (dbbrowser->list),
procs_list);
if ( dbbrowser->clist ) {
;
}
g_free( proc_list );
gtk_window_set_title (GTK_WINDOW (dbbrowser->dlg),
"DB Browser");
gtk_clist_thaw(GTK_CLIST(dbbrowser->clist));
}
......@@ -628,6 +584,16 @@ convert_string (char *str)
}
}
static void
unconvert_string (char *str)
{
while (*str)
{
if (*str == '-') *str = '_';
str++;
}
}
static char*
GParamType2char(GParamType t)
{
......
......@@ -52,6 +52,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h> /* For random seeding */
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
......@@ -66,6 +67,8 @@
typedef struct {
gint seed;
gdouble turbulence;
/* Interface only */
gboolean timeseed;
} PlasmaValues;
typedef struct {
......@@ -92,7 +95,7 @@ static void plasma_entry_callback (GtkWidget *widget,
gpointer data);
static void plasma_scale_update (GtkAdjustment *adjustment,
gpointer data);
static void toggle_callback (GtkWidget *widget, gboolean *data);
static void plasma (GDrawable *drawable);
static void random_rgb (guchar *d);
static void add_random (guchar *d, gint amnt);
......@@ -117,7 +120,8 @@ GPlugInInfo PLUG_IN_INFO =
static PlasmaValues pvals =
{
0, /* seed */
1.0 /* turbulence */
1.0, /* turbulence */
TRUE /* Time seed? */
};
static PlasmaInterface pint =
......@@ -231,7 +235,8 @@ run (gchar *name,
gimp_displays_flush ();
/* Store data */
if (run_mode == RUN_INTERACTIVE)
if (run_mode == RUN_INTERACTIVE ||
(pvals.timeseed && run_mode == RUN_WITH_LAST_VALS))
gimp_set_data ("plug_in_plasma", &pvals, sizeof (PlasmaValues));
}
else
......@@ -255,6 +260,8 @@ plasma_dialog()
GtkWidget *button;
GtkWidget *label;
GtkWidget *entry;
GtkWidget *seed_hbox;
GtkWidget *time_button;
GtkWidget *scale;
GtkObject *scale_data;
gchar **argv;
......@@ -306,8 +313,14 @@ plasma_dialog()
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, 0, 5, 0 );
gtk_widget_show (label);
seed_hbox = gtk_hbox_new(FALSE, 2);
gtk_table_attach (GTK_TABLE (table), seed_hbox, 1, 2, 0, 1,
GTK_FILL, GTK_FILL, 0, 0 );
gtk_widget_show (seed_hbox);
entry = gtk_entry_new ();
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0 );
gtk_box_pack_start(GTK_BOX(seed_hbox), entry, TRUE, TRUE, 0);
gtk_widget_set_usize( entry, ENTRY_WIDTH, 0 );
sprintf( (char *)buffer, "%d", pvals.seed );
gtk_entry_set_text (GTK_ENTRY (entry), (gchar *)buffer );
......@@ -316,6 +329,15 @@ plasma_dialog()
&pvals.seed);
gtk_widget_show (entry);
time_button = gtk_toggle_button_new_with_label ("Time");
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(time_button),pvals.timeseed);
gtk_signal_connect (GTK_OBJECT (time_button), "clicked",
(GtkSignalFunc) toggle_callback,
&pvals.timeseed);
gtk_box_pack_end (GTK_BOX (seed_hbox), time_button, FALSE, FALSE, 0);
gtk_widget_show (time_button);
gtk_widget_show (seed_hbox);
label = gtk_label_new ("Turbulence");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, 0, 5, 0);
......@@ -382,7 +404,11 @@ plasma_scale_update (GtkAdjustment *adjustment,
*dptr = adjustment->value;
}
static void
toggle_callback (GtkWidget *widget, gboolean *data)
{
*data = GTK_TOGGLE_BUTTON (widget)->active;
}
#define AVE(n, v1, v2) n[0] = ((gint)v1[0] + (gint)v2[0]) / 2;\
n[1] = ((gint)v1[1] + (gint)v2[1]) / 2;\
......@@ -433,6 +459,9 @@ plasma(GDrawable *drawable)
static void
init_plasma( GDrawable *drawable )
{
if (pvals.timeseed)
pvals.seed = time(NULL);
srand( pvals.seed );
turbulence = pvals.turbulence;
......
......@@ -47,7 +47,6 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
GtkWidget *button;
GtkWidget *hbox,*searchhbox,*vbox;
GtkWidget *label;
GtkWidget *list_scroll;
dbbrowser = (gpointer)malloc(sizeof(dbbrowser_t));
......@@ -80,22 +79,16 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* list : list in a scrolled_win */
list_scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (list_scroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
dbbrowser->clist = gtk_clist_new(1);
gtk_clist_set_selection_mode (GTK_CLIST (dbbrowser->clist),
GTK_SELECTION_BROWSE);
gtk_widget_set_usize(dbbrowser->clist, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_signal_connect (GTK_OBJECT (dbbrowser->clist), "select_row",
(GtkSignalFunc) procedure_select_callback,
dbbrowser);
gtk_box_pack_start (GTK_BOX (vbox),
list_scroll, TRUE, TRUE, 0);
gtk_widget_set_usize(list_scroll, DBL_LIST_WIDTH, DBL_HEIGHT);
gtk_widget_show(list_scroll);
dbbrowser->list = gtk_list_new();
gtk_list_set_selection_mode (GTK_LIST (dbbrowser->list),
GTK_SELECTION_BROWSE);
gtk_signal_connect (GTK_OBJECT (dbbrowser->list), "button_press_event",
(GtkSignalFunc) dialog_list_button, dbbrowser);
gtk_container_add (GTK_CONTAINER (list_scroll), dbbrowser->list);
gtk_widget_show(dbbrowser->list);
dbbrowser->clist, TRUE, TRUE, 0);
gtk_widget_show(dbbrowser->clist);
/* search entry */
......@@ -168,7 +161,7 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
/* now build the list */
gtk_widget_show (dbbrowser->list);
gtk_widget_show (dbbrowser->clist);
gtk_widget_show (dbbrowser->dlg);
/* initialize the "return" value (for "apply") */
......@@ -195,39 +188,27 @@ gimp_db_browser(void (* apply_callback) ( gchar *selected_proc_name,
static gint
dialog_list_button (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
procedure_select_callback (GtkWidget *widget,
gint row,
gint column,
GdkEventButton * bevent,
gpointer data)
{
gchar *text, *temp;
dbbrowser_t *dbbrowser = data;
GtkWidget *event_widget;
gchar *proc_name;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
// g_return_val_if_fail (bevent != NULL, FALSE);
g_return_val_if_fail (dbbrowser != NULL, FALSE);
event_widget = gtk_get_event_widget ((GdkEvent*) event);
if (GTK_IS_LIST_ITEM (event_widget))
{
switch (event->type)
{
case GDK_BUTTON_PRESS:
proc_name = gtk_object_get_user_data (GTK_OBJECT (event_widget));
/* gtk_widget_grab_focus (fs->selection_entry); */
dialog_select (dbbrowser, proc_name);
break;
case GDK_2BUTTON_PRESS:
if (dbbrowser->apply_callback) {}
/* gtk_button_clicked (GTK_BUTTON (fs->ok_button)); */
break;
default:
break;
}
}
if (gtk_clist_get_text (GTK_CLIST (widget), row, column, &temp)) {
text = g_strdup(temp);
unconvert_string(text);
dialog_select (dbbrowser, text);
g_free(text);
}
return FALSE;
}
......@@ -456,7 +437,7 @@ dialog_select (dbbrowser_t *dbbrowser,
gtk_widget_show(label);
row++;
/* TODO
/*
label = gtk_label_new("Help :");
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
gtk_table_attach (GTK_TABLE (dbbrowser->descr_table), label,
......@@ -464,8 +445,7 @@ dialog_select (dbbrowser_t *dbbrowser,
GTK_FILL, GTK_FILL, 3, 0);
gtk_widget_show(label);
insert help here
but gtk_text seems bugggggggyyy */
TODO: Add help */
if (old_table) gtk_widget_destroy(old_table);
......@@ -480,7 +460,7 @@ dialog_close_callback (GtkWidget *widget,
/* end of the dialog */
{
dbbrowser_t* dbbrowser = data;
if (dbbrowser->apply_callback) {