Robin Lee Powell <[email protected]> writes:

> On Mon, Mar 16, 2009 at 11:17:41AM +0100, Jan Rychter wrote:
>> 
>> Robin Lee Powell <[email protected]> writes:
>> > On Sun, Mar 15, 2009 at 06:23:06PM +0100, Jan Rychter wrote:
>> >> 
>> >> I would like to ask for agreement on how we specify
>> >> selected/disabled (and hidden) panes for render-menu. In my
>> >> trees they were specified by uri-token, not the human-readable
>> >> name. I had a very good reason for that: it's consistent, it's
>> >> precise, and I didn't have any issues with menu items that have
>> >> names with non-ASCII characters in them. Things worked fine,
>> >> but now as I transition to the latest weblocks-dev I find that
>> >> things are broken again.
>> >> 
>> >> Could we please agree that all render-menu arguments (except
>> >> for the car in option cells) use tokens, not names? Is this a
>> >> problem for anyone?
>> >
>> > For those of us that are behind the curve, can you give more
>> > detail? A code example of the two approaches would be especially
>> > nice.
>> 
>> It's about the API to the render-menu function -- I believe we
>> should use human-readable names only for human-visible output, all
>> the rest of the API should use uri-tokens. This means that when
>> you specify what the :selected-pane is, you pass it
>> (static-selector-current-pane obj) (see widgets/navigation.lisp),
>> you don't look for the human-readable name.
>
> I really work best with code examples.  I'd really like to see one.

I'm not sure I understand what you're looking for -- it's really all
about this little change in src/snippets/menu.lisp:

@@ -31,8 +31,7 @@ the navigation as disabled."
                                  (attributize-name option))))
                    (let* ((label (car option))
                           (target (cdr option))
-                          (pane-selected-p (equalp (attributize-name (car 
option))
-                                                   (or selected-pane "")))
+                         (pane-selected-p (equalp target (or selected-pane 
"")))
                           (pane-disabled-p (member (attributize-name (car 
option))
                                                    disabled-pane-names
                                                    :key #'attributize-name

see also the render-navigation-menu function in navigation.lisp, how it
uses the selector's knowledge of the currently selected pane and passes
it on to render-menu. Selectors know nothing about human-readable names,
they only deal with parts of an URL.

--J.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to