[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: blocking operation
- From: Gustavo Joćo Alves Marques Carneiro <ee96090 fe up pt>
- To: gtk-app-devel-list redhat com
- Subject: Re: blocking operation
- Date: Tue, 29 Feb 2000 16:07:34 +0000 (WET)
Is it a modal dialog that you want? If so, take a look at
gtk_window_set_modal and gnome_dialog_run.
On Tue, 29 Feb 2000, Peter Wurmsdobler wrote:
> hi,
>
> In any callback where I want to open a file selection window
> which should return a pointer to the file name I want to use
> a unique function. Therefore, once the File_Selection Widget
> is shown, the function should block until it is released by
> an event like in the following code:
>
> char * dialog_file_name;
>
> void dialog_file_ok_button_clicked( void )
> {
> dialog_file_name = gtk_file_selection_get_filename
> ( GTK_FILE_SELECTION( Dialog_File_Window ) );
>
> gtk_widget_hide( Dialog_File_Window );
>
> /* unblock here */
> }
>
> void dialog_file_cancel_button_clicked( void )
> {
> gtk_widget_hide( Dialog_File_Window );
> dialog_file_name = NULL;
>
> /* unblock here */
> }
>
> char * dialog_file_window( void )
> {
> if ( Dialog_File_Window == NULL )
> dialog_file_create();
>
> if ( dialog_file_lock < 0 )
> {
> dialog_error_window( "FILE_WINDOW_OCCUPIED" );
> return NULL;
> }
> else
> {
> dialog_file_lock = -1;
> gtk_widget_show_all( Dialog_File_Window );
> }
>
> /* block here on something */
>
> dialog_file_lock = 0;
> return dialog_file_name;
> }
>
> The solution is probably not the best, but I wanted to share
> only one object within the application and this is what I found.
> I know some blocking things should exist in gtk, but I don't
> know what I should look for.
>
> Any hints are very much appreciated,
> peterw
>
--
Gustavo J.A.M. Carneiro
[reinolinux.fe.up.pt/~ee96090]
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]