How retrieve the selection with gtk?

2007-06-14 Thread eldruida
Hello, and sorry for my English.

In the tutorial,http://www.gtk.org/tutorial/x1852.html, there are two
examples for handle selections, but I will retrieve data of selection
when the selection is made. And i don't find any other examples.

Can anybody put a small example, I'm somewhat lost, xD.

Thanks.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Disable ALL keybindings for a specific widgit?

2007-06-14 Thread Justin Stallard
Hi,

I've looked through the tutorial, faq, API doc, and even google and I
can't seem to find out if there's some way to unbind all the
keybindings associated with a particular widgit. Is there?

What I want to have is this:
A GtkEntry that does not respond to Left, Right, Insert, or any
other keybindings or key presses so that I can handle them myself as
key_press_events.

Any and all help will be greatly appreciated.

Thank you,
-Justin
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk + glxcontext/opengl

2007-06-14 Thread Daren Lee
Hi -

I'm developing an OpenGL app on RedHat Linux WS 4 that uses freeglut to
manage the underlying windowing system. I'm also using multiple
rendering contexts with multi threads.

This is my first GTK code and my goal is to use GTK to display a file
browser dialog box to open/save files. This is the GTK code:

//--
-
// gtk
bool
OpenFileNames ( std::vectorstd::string vFileNames ) { char *filename;
GtkWidget *dialog = NULL; dialog = gtk_file_chooser_dialog_new (Open
File,
 NULL,  
 GTK_FILE_CHOOSER_ACTION_OPEN,
 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
 NULL);
if( !dialog ) return false;

bool bSuccess = false;
if( gtk_dialog_run ( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT ) {
filename = gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER ( dialog
) );
vFileNames.push_back( filename );
g_free( filename );
bSuccess = true;
}
gtk_widget_destroy( dialog );

// Make sure widget gets removed from screen while( gtk_events_pending()
) gtk_main_iteration();

// flush X events
gdk_flush();

return bSuccess;
}
//--
-

After OpenFileNames() returns, a loading thread is then launched. Inside
this loader thread, a call to glxMakeCurrent() is made to change
rendering contexts for multithreaded OpenGL operation.

The X error I receive is:

The error was 'GLXBadContextTag'. (Details: serial 1481 error_code 161
request_code 144 minor_code 5)

I used gdb with --sync and broke on gdk_x_error() and the backtrace is:

#0 gdk_x_error
#1 _XError
#2 _XReply
#3 glxChannelRectSyncSGIX

My questions are:

0) is using gtk in this way (ie: integrating with freeglut) a good thing
to do? Freeglut uses X11 code but it manages everything in a black box.
Have any other people had success with this combo?

1) is it kosher to user gtk_main_iteration() like this? Since I don't
need any other gtk widgets, I want to avoid using gtk_main(). 

2) I commented out the glxMakeCurrent() and gtk seems happy, although
nothing loads of course. I also added a sleep function before the load
thread launches and it works periodically but still crashes sometimes.
So what I am thinking is that some gdk events are being processed by X
after the rendering context switch. Hence, I added gdk_flush() but it
doesn't help. Is there another way to force all the gdk events to be
processed by X?

Not sure it matters but I'm using nVidia driver 97.46.

Thanks,
Daren



___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list