[EMAIL PROTECTED] writes:

> Next step involves mapping through the list of accounts, and asking the
> user to pick a favorite account.  This probably mandates creating a
> GTK dialogue looking something like:
> 
> ======================================================
> Category Translation Selection
> 
> QIF file category "Rent" had 17 entries in the file.
> Best matches included:
> [ Rent ]         Exact match
> [ Auto Rent ]    Partial match
> [ Restaurants ]  First letter match
> [ null ]         Item from Category list
> [ Pick from Category List ]
> [ Create new category for this item ]    
> ======================================================
> 
> where the [braces] indicate a button that one would press to select
> the option given.
> 
> I can probably "Glade" a function into place for this, although the
> "query Category list" items are liable to be hairy...

If you were willing to change the design so that the selections was
just a list of buttons with potentially long names (like "Rent: exact
match"), then one function could probably handle both this dialog and
a category-list sub-dialog:

  (gnc:choose-from-list-dialog title
        list-of-button-name-thunk-pairs-alist-or-hash-or-whatever)

Where the function puts up the dialog with the given buttons in a
vertical scrollbox and a cancel button at the bottom, and calls the
thunks whenever the buttons are pressed, and returns whenever one of
the thunks returns '(result <foo>), the function returns '(result
<foo>), where foo is some value.  If the user presses cancel, the
function should return a simple #f.

Forcing the thunk to tell the dialog that it's done allows you to have
the buttons that bring up sub-dialogs.

Would that do most of what you want?

> Of course it would be in the main README...  Teaches me to not look
> close enough...

This stuff was just added in the past week or two, so if you looked
before, it wouldn't have been there (at least not this new "improved"
method.

> I suspect that guile-in-window is liable to be really quite useful for
> debugging scripts as it allows me to be reasonably sure that I've got
> the same environment that I see if I load the register.

I'll see how hard it would be.  I wanted it the other day myself.

> I'll see how it goes without it.

Keep me posted.

-- 
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
----- %< -------------------------------------------- >% ------
The GnuCash / X-Accountant Mailing List
To unsubscribe, send mail to [EMAIL PROTECTED] and
put "unsubscribe gnucash-devel [EMAIL PROTECTED]" in the body

Reply via email to