gtkfilesel.c




Hi all,

I'm relatively new to gtk so I may be doing something stupid.

Is anyone having problems with the files selection widget.

I am using gtk+-0.99.0.tar.gz on a Linux system with the changes below
(found on this list a while ago) to get it to compile:

> > commented out wchar.h in
> > gdktypes.h
> > gdki18n.h
> >
> > which revealed the next problem, which requires adding the following
> > line
> > at top of gtkentry.h
> > #define iswalnum isalnum

At random times while using the file selection dialog (usually while
double clicking "../" in the Directories window), I get the following:

** ERROR **: sigsegv caught

I have NOT been able to reproduce this problem with a simple program
which leads me to believe the problem is probably in my code, but I
did see a post about there still being some problems with the
filesel.c file not too long ago and I couldn't tell if they had been
fixed in the version I have.  My experience has been that "random
errors" like I have are usually a result of incorrectly accessing
memory locations and the program may not bomb where the problem is.

I am also using the gtkGL widget (version 0.3) that was announced here
not too long ago and I may be using it incorrectly or there may be a
bug in it.

Anyway, I am just wondering if there are any known patches to the
filesel.c file that have not been included in gtk+-0.99.0.tar.gz

Also, what is the proper way to popup a file selection dialog multiple
times?  What I am currently doing is executing the following code
whenever I want to pop-up a file selection dialog.  I only create
window_ once and then just hide it in the ok callback.

  okFunc_ = okFunc;
  okData_ = okData;
  if (!window_) {
    window_ = gtk_file_selection_new(windowTitle);
    gtk_object_set_data(GTK_OBJECT(window_), "GkFileSelection", this);
    gtk_window_position(GTK_WINDOW(window_), GTK_WIN_POS_MOUSE);

    /*
    gtk_signal_connect(GTK_OBJECT(window_), "destroy",
			GTK_SIGNAL_FUNC(destroy_window),
			&window_);
    gtk_signal_connect(GTK_OBJECT(window_), "delete_event",
			GTK_SIGNAL_FUNC(destroy_window),
			&window_);
			*/
    gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window_)->ok_button),
			"clicked",
                        GTK_SIGNAL_FUNC(GkFileSelection::okCB),
		       window_);
    gtk_signal_connect_object
      (GTK_OBJECT(GTK_FILE_SELECTION(window_)->cancel_button),
       "clicked", GTK_SIGNAL_FUNC(GkFileSelection::cancelCB),
       GTK_OBJECT(window_));
  }
  else {
    gtk_window_set_title(GTK_WINDOW(window_), windowTitle);
  }
  
  if (!GTK_WIDGET_VISIBLE(window_))
    gtk_widget_show(window_);

Thanks,
Dave Reed
dreed@capital.edu



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]