Re: [Anygui-devel] Request (for the rewrite): default layout model
Brought to you by:
mlh
From: Magnus L. H. <ma...@he...> - 2002-04-19 12:18:10
|
Lalo Martins <la...@la...>: > > Granted, most UI toolkits use a geometry-based layout model, like in > Anygui's tutorial (where you set x and y). > > But new toolkits tend toward an "intelligent" layout model, like GTK+, and > while it's not too hard to emulate that in a geometry-based model, it's a > major pain to emulate geometry-based layout in GTK+ or PicoGUI. Perhaps you could outline how this stuff works? (Doesn't sound very intelligent if you can't set coordinates...) > I'd suggest, then, that the default layout model in the next versions of > Anygui should be similar to GTK+'s, emulated in Python for the toolkits that > don't support this (I believe a single layout manager object can handle all > other toolkits due to Anygui's power), and using the toolkit's defaults when > possible (GTK+, PicoGUI, perhaps others I'm not aware of). I think using the backend's default mechanism etc. may very well be beneficial (due to better appearance etc.), but I think that should then be done with some sort of passthrough mechanism. (We already have the mechanism for getting preferences from a backend widget, such as preferred or minimal size etc.) My initial reaction is that I don't want to drop the geometry stuff as the base line. The idea is that any layout can be built on top of that. Now, if we build a layout manager that fits exactly on top of the layout provided by a backend (or more than one), then it should probably be possible to let the backend handle it (as discussed) -- but that's an optimisation, and I don't think it will be necessary to add in 0.2. What you're asking, however, seems to be something else: To adopt a non-coordinate-based layout mechanism from GTK+, because GTK+ cannot handle coordinates. (Am I understanding this right?) Is that really true? Can't you set coordinates in GTK+? (Whether it is a "pain" or not isn't that important -- it will only have to be done once anyway, in the backend... And, as I said, it can probably be circumvented as an optimisation.) It seems to me that simple, plain coordinates is the easiest "lowest common denominator" in layout. It also fits very nicely with the general Anygui attribute model. That said, I'm very interested in hearing how the GTK+ approach works. (And, as an aside, we should/must get better layout mechanisms in Anygui too -- the current one is too verbose for may applications IMO.) > (Besides, this is a lot easier to code for. This morning I was > preparing a lecture and I realized writing simple UI code with > Anygui is faster, easier and more readable than the corresponding > python-glade stuff. Way to go.) Wow -- cool... I didn't think Anygui was of much use yet myself ;) > []s, > |alo > +---- - Magnus (who *is* making progress on 0.2 -- honest :) -- Magnus Lie Hetland The Anygui Project http://hetland.org http://anygui.org |