Re: RFC GnomeGoal #3

On Fri, 11 Aug 2006, ext Havoc Pennington wrote:

> A good API for saving window state is probably something like:
>   gtk_window_save_state(GtkWindow *window, const char *window_key);
> which would magically know which things to save (including 
> _NET_WM_STATE), would magically save a different state per screen size, etc.
> There's no way apps will get this right without something on that level...
> At the same time an API like this punts the hard issue on the gtk level 
> (when are two windows "the same" so state should be restored?) - the app 
> has to provide the same window_key for any two "the same" windows.

I did something like this in one of my projects; but instead of
GtkWindow, I used GtkWidget.

Because (at least in my case), not only the window state should be
saved, but possibly more stuff. Ie. I'd like to restore my GtkPaneds to
the same sizes. I want my list columns at the same size, same order. I
might even want to select which columns are visible, what is the sorting
order... and similar for all other widget types.

It wouldn't be that hard to figure out the relevant properties from a
widget, but it's quite hard how to figure out how they go together
(packing, expand, fill etc.). E.g., window size often depends on the
size of their biggest child. So to make a "It Just Works" API, you'd
have to save the state of *all* widgets which have properties with
non-default values. Which makes things a bit harder.

Best wishes,

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