[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725)
From: |
joakim |
Subject: |
Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725) |
Date: |
Fri, 16 Jan 2015 22:16:57 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
>> From: address@hidden
>> Cc: address@hidden, address@hidden
>> Date: Fri, 16 Jan 2015 21:50:20 +0100
>>
>> (defmacro xwidget-demo (name &rest body)
>> `(defun ,(intern (concat "xwidget-demo-" name)) ()
>> (interactive)
>> (switch-to-buffer ,(format "*xwidget-demo-%s*" name))
>> (text-mode);;otherwise no local keymap
>> (insert "Some random text for xwidgets to be inserted in for demo
>> purposes.\n")
>> ,@body))
>>
>> (xwidget-demo "a-button-bidi"
>> (xwidget-insert (point-min) 'Button "button" 60 50)
>> (set (make-local-variable 'bidi-paragraph-direction)
>> 'right-to-left)
>> (define-key (current-local-map) [xwidget-event]
>> 'xwidget-handler-demo-basic))
>>
>> and I get a buffer with some text that behaves in R2L mode, and a gtk
>> button embedded in the text.
>>
>> The button doesnt seem to move with the text as it should, it stays
>> glued to the right window edge for some reason.
>>
>> I tried adding some missing bidi code in produce_xwidget_glyph() but the
>> result is the same, so I'm obviously missing something. Any ideas?
>
> I'm not sure I'm following, sorry. Can you show a screenshot, and
> explain what did you mean by "move with the text as it should"?
>
> Also, what text did you insert? If my reading of the defmacro and its
> call is correct, you just put a single button alone on its line, in
> which case it should behave like a single character, and should be
> displayed at the right edge of the window when paragraph direction is
> right-to-left.
Maybe this is a bit clearer.
Here in the L2R case, I insert a button in the middle of the text. If I
type more text, the buttone moves along with the text towards the right
edge. This is the expected behaviour.
(xwidget-demo "a-button"
(xwidget-insert (+ 15 (point-min)) 'Button "button" 60 50)
(define-key (current-local-map) [xwidget-event]
'xwidget-handler-demo-basic))
In the next case the button is also in the middle of the text at
first. However, when the direction is changed to right-to-left, the text
sticks to the right edge as expected, but the button jumps to the edge
rather than staying within the text. If I type some text, the text move
right to left, but the button just stays there at the right edge.
(xwidget-demo "a-button-bidi"
(xwidget-insert (+ 15 (point-min)) 'Button "button" 60 50)
(set (make-local-variable 'bidi-paragraph-direction)
'right-to-left)
(define-key (current-local-map) [xwidget-event]
'xwidget-handler-demo-basic))
xw-bidi1.png
Description: PNG image
--
Joakim Verona
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/09
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), Eli Zaretskii, 2015/01/09
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/16
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), Eli Zaretskii, 2015/01/16
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725),
joakim <=
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), Eli Zaretskii, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), Eli Zaretskii, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), Eli Zaretskii, 2015/01/17
- Re: [Emacs-diffs] xwidget updated (1d8b8a2 -> 5f46725), joakim, 2015/01/17