bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11148: 23.3; x-popup-menu not behaving as documented


From: Dino Chiesa
Subject: bug#11148: 23.3; x-popup-menu not behaving as documented
Date: Sun, 1 Apr 2012 13:36:48 -0700

K, thanks for the reply.
I'll let you guys figure out what you want to do about 11138;

It may be that doc changes are the way to fix 11148.\
-Dino

-----Original Message----- From: Drew Adams
Sent: Sunday, April 01, 2012 9:19 AM
To: 'Dino Chiesa' ; 11148@debbugs.gnu.org
Subject: RE: bug#11148: 23.3; x-popup-menu not behaving as documented

(x-popup-menu
  t
  (list "TITLE"
        (list "PANE" (list "menu item 1" nil)
        (list "menu item 2" nil))))
...shows a menu in which both items are selectable.

This bug may be relevant to bug #11138. One of the proposed fixes for
#11138 at the time of this report is to render a multi-line dialog box
as a menu, with each "line" in the message displayed as an unselectable
menu item.

But this brief test seems to indicate that the "unselectable"
menu items are not really unselectable, at least on Windows.
In that case the proposed fix would be unsatisfactory.

First, I don't really care how bug #11138 is fixed.

My point in suggesting splitting a message at \n chars was that the bug can be fixed - even if in a rudimentary way by treating the message's separate lines as
separate menu lines (since the code on MS Windows currently treats a
`message-box' as a popup menu).

Here is what I mean (one way), using the bug report's multiline message:

(defun foo (event)
 (interactive "e")
 (let ((choice  (x-popup-menu
                event
                  '("Message"
                    ("" "First line in a long-ish message.")
                    ("" "This is line number 2 in the message.")
                    ("" ("OK"))))))
   (and choice  (call-interactively choice))))

(global-set-key [double-mouse-2] 'foo)
(global-set-key [mouse-2] nil)

Double-click mouse-2. The message's lines are indeed handled as unselectable
menu items (yes, on MS Windows).

Is that the best looking implementation of a message dialog box?  Not IMO.

But given the desire to implement a message box using `x-popup-menu', that shows at least that it can be done. Is that better than the current implementation,
which jams the multiple lines of the message together?  Maybe.

Certainly we can hope for a better implementation.  Stefan suggested using a
tooltip frame, for instance. And maybe (?) at least some of the implementation
could be moved from C to Lisp.

I'd like to also raise a documentation bug, as well: there ought to be
examples showing how to use x-popup-menu, on the page I cited above.
A few simple examples will make this method much more usable.

Agreed, especially since there are a few different ways to use `x-popup-menu':
keymap, list of keymaps, or menu of multiple panes, the last of these being
radically different from the first two and unique wrt the rest of Emacs.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]