Subject: bug#69457: unable to place two menu-choice widgets on same line

From: Mauro Aranda <[email-masked]>
Date: Thu, 29 Feb 2024 12:24:03 -0300

tags 69457 notabug
close 69457
quit

[email-masked] writes:

 >> Yes, you need to control the :format for the choices to accomplish
 >> this, at least.
 >>
 >>> some example code i have:
 >>>
 >>> (defun lem-ui-return-item-widgets (list)
 >>>    "Return a list of item widgets for each item, a string, in LIST."
 >>>    (cl-loop for x in list
 >>>             collect `(choice-item :value ,x)))
 >> So, how about adding something like:
 >> :format "%[%t%] "
 >> here?
 >> Did you try that?
 >
 > thanks a lot, this works. i see now i had been shedding tears fighting
 > with the menu-choice :format, not realizing i needed to wrangle the
 > children elements instead. glad i asked the widget expert. %v also
 > seems to work here, right?

I'm glad it worked.  %v should work too, depends on what you need.

 >>> ;; then within a buffer display function:
 >>>   (widget-create 'menu-choice
 >>>                       :tag "Listing"
 >>>                       :value type
 >>>                       :args (lem-ui-return-item-widgets 
lem-listing-types)
 >>>                       :help-echo "Select a listing type"
 >>>                       :format (lem-ui-widget-format "Listing") ; 
"C-c C-c")
 >> What's the intention with the "C-c C-c"? Could it go at the end of
 >> the :format suggestion I gave above?
 >
 > yes, with the above :format it should work.
 >
 > thanks again for chiming in and helping me out!

You're welcome.  It seems there's nothing more to do with this bug
report, so I'm marking it as notabug and closing it.

Feel free to reach me if you need further help.