Go forward in time to April 2004.
Miguel has been tempting me to do something about canvases and XAML/Avalon, so I've been reading up on the latter. It's quite cool. Since the days of RHAD Labs there has been talk of moving GTK+ to a canvas-based model. Perhaps for 3.0 we could do something about it.
The ruins of the house of Hernán Cortés, at La Antigua, are being slowly devoured by a house-eating tree of death.
Wrote a patch for a bug in Epiphany related to the response codes it uses for the buttons in a GtkFileChooserDialog. This is a quirk that is described in another bug: one must use one of the stock response codes for "accept"-type buttons in GtkFileChooserDialog, otherwise it may return folders rather than files. That is, the codes you can use for your "Open" or "Save" button are GTK_RESPONSE_ACCEPT, GTK_RESPONSE_OK, GTK_RESPONSE_YES, and GTK_RESPONSE_APPLY.
The nasty details are in gtkfilechooserdialog.c:response_cb(). In GTK+, buttons in dialog boxes have numerical response codes. For historical reasons, stock buttons don't have stock response codes associated to them: nothing forces you to use GTK_RESPONSE_OK for a GTK_STOCK_OK button. People often define custom response codes for dialog boxes, even when they could be using the values in GtkResponseType. For dialog boxes with just "cancel" and "do something" buttons, it is best if you just use GTK_RESPONSE_CANCEL and GTK_RESPONSE_ACCEPT — this makes your code simpler, as you have to keep track of fewer magic values. In the case of GtkFileChooserDialog, this is necessary, not just recommended practice.
I've added a section to the GTK+ documentation that explains this.
Mitch's patch to make the GIMP use GtkFileChooser makes things very nice.
We went shopping for plants yesterday, and got a lovely gardenia, a buganvilla, and a small palm.
The transcript of Bruce Sterling's rant-a-thon is really interesting!
JRB is my hero; he rewrote GtkFileChooserEntry over an all-nighter this weekend, and the Location dialog is now beautiful, with working autocompletion and everything.
The bombings in Madrid are horrible, just horrible. Oralia was feeling uncomfortable last night as we went to bed, which must have been around the time of the explosions.
What makes people go out of their way to to kill random strangers in the street?
Oh my god, Oralia made chicken skewers with red peppers, onions, chorizo, and bacon, and they were soooooo good... It's the kind of food that puts me in a very good mood.
Drag-and-drop works fully in the file chooser's bookmarks list now. You can:
This is not really screenshotable, so go try it out!
I didn't do any hacking over the weekend as we drove to Mexico City early on Saturday morning. In the meantime, JRB has been rocking the house. He fixed folder mode! My hero.
Owen told me about the following problem. Until today, GtkFileChooserDialog had a bug where, when being used in file mode (e.g. to select files, not folders):
That is, it would issue a response to the client rather than entering the folder you clicked in the first step. To work around this, people would do horrible things similar to the following:
while (TRUE) {
int response;
gboolean done;
done = TRUE;
response = gtk_dialog_run (my_file_chooser);
if (response == GTK_RESPONSE_OK) {
char *filename;
filename = gtk_file_chooser_get_filename (my_file_chooser);
if (is_folder (filename)) {
gtk_file_chooser_set_current_folder (filename);
done = FALSE;
} else
go_ahead_and_do_something_with (filename);
g_free (filename);
}
if (done)
break;
}
You should NOT do this in your program. This bug has been fixed, and the file chooser will no longer return a folder name if you are in file selection mode.
Some culprits:
Also, many people seem to be using a ::response() callback handler and making their lives hard by running the file chooser dialog in its own main loop by hand. You should never need to do this. This is even documented; you should use gtk_dialog_run() instead.
If you find that using GtkFileChooser forces you to do cumbersome things like this, it is most likely a bug. The file chooser API is intended to be easy and convenient. If you think the API forces you to use it in uncomfortable ways, please file a bug or ask on the gtk-devel-list mailing list.
For lunch Oralia made an excellent fish in chipotle sauce, and white rice with potatoes and garlic. Holy deliciousness, Batman! Maybe the seafood restaurant in Mocambo will go the way of the other restaurants-that-have-been-trounced-by-my-wife's-cooking-skills...
On Saturday we went to Jerusalem, a middle-eastern restaurant we had been wanting to try out. What a nice surprise! The owner is an Egyptian who worked in the embassy in Mexico, and has lived for 25 years here. The food was quite excellent, and reasonably cheap.
After lunch, we went to have a walk around Parque Tecajetes. It is a beautiful
place. I have a recurring dream of being in a park
dense with flora, stone walkways, bridges, and ponds.
This park seems to match the dream very well.
Over the weekend we also watched two very good movies: Mystic River and Lost in Translation. The latter has some amazing photography. I love the dark scene in the bar, with Bob and Charlotte at opposite sides of the screen, with the only light falling on their hands; one of them with cigarettes and the other one with whisky.
Oh, yes, the Oscars happened. They were boring and full of chaff. The actresses looked oversprayed. LoTR got what it deserves.
We decided to make use of the beautiful weather yesterday to go to Veracruz. We had breakfast at La Parroquia. When one is there it is pointless to order anything but their delicious picadas con huevo and lecheros, so we had precisely that. Then we just walked around the main square, had a guanabana milkshake, went to the beach, watched people build sand castles, and just relaxed. When we got hungry again, we went to Mocambo for the usual superb seafood.
JRB has been kicking ass with the file chooser, as he has been taking care of many of the dirty loose ends. I'll have to get him a beer some time.
Today Oralia made a great lunch; lentil soup, and a fantastic salmon stuffed with mushrooms and epazote, all baked with orange juice. She deserves another trip for lecheros, one of her uncontrollable addictions.
GtkFileChooser in Save mode. I know the "Open" button should say "Save", but this is from the testfilechooser program, which always uses that button.
I'm sure I'm going to get complaints about this, which I'll happily ignore.
Go backward in time to February 2004.
Federico Mena-Quintero <federico@gnome.org> Mon 2004/Mar/01 12:37:54 CST