Re: Generic file select



Quoted by a team of ultra midgets
For `Ian Bell <ian ruffrecords worldonline co uk>' 
On Wednesday, 19 November 2003 (14:13):


For example i have a menu callback which needs allow the user to select a file

name, then loads it.  For preference I would like to be able to write:

mystring = getavalidfilename("My File Dialog Title");
if(mystring != NULL)
{
      loadfile(mystring);
}
else
{
      handle_error();
}

The problem I have is the example in the gtk docs returns immediately and the 
filename is set some time later in in an external variable.


        You can call gtk_main() inside getavalidfilename(), set some external variable
when the OK button is pressed, then call gtk_main_quit() and return that
variable.

-- 

 Leandro Pereira              (oO)           <leandro linuxmag com br>
                              /||\                  www.mindcrisis.tk

        Pontualidade e a coincidencia de duas pessoas chegarem com o 
        mesmo atraso.
                -- Leon Eliachar




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