Re: FileSelection package


"D. Gregory" wrote:

It print "Set file..." after i press the "valid" button, so my question 
is how to determine when a window/file selection is destroy, or how to 
wait for it to return a value.
When I started with Gtk I expected dialogs to block until I pressed a
button on the dialog - which I guess is a mistake in an event-driven app.

I now look at Gtk programs in a different way so that when I construct
and show a dialog, the main app immediately carries on behind it. When
I want to open a file, I show the dialog and connect anonymous subs
(closures) to the buttons as you have in your example. I use those subs
to load the file and do whatever is necessary to display it. In your 
example this would be the set_file() code. 

The app is never 'waiting' for the user interaction but when the user 
clicks the 'OK' button, something happens while the main app continues 
to process data or update the UI all the time.

I can't think of a reason to stop the app until the user enters a file
name but there must be one :)

Regards, Dermot

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