[racket] Reordering tabs in DrRacket

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Oct 11 22:29:02 EDT 2013

This is probably a bug either in the on-demand handling or in the way that
the framework uses it. It isn't supposed to be possible for you to write
code that gets that wrong, I think.

Specifically, in drracket/private/main.rkt, there is a call
to group:add-to-windows-menu that sets up a callback that is supposed to be
called whenever the menu is opened (the call happens via
the update-windows-menu method in gui-lib/framework/private/group.rkt) and
that code should always get those menus right.

I believe that there are some situations, due to the way eventspaces work
and the way that racket/gui has to fight with ubuntu that makes creation of
new menu items during an on-demand callback not work right and probably
that shouldn't be happening there.

Probably the best thing is for you to do something like calling
the update-windows-menu method of the frame group directly (something like
the call you see in the on-demand callback in group.rkt) and then things
will work and probably I need to adjust the framework code so that it calls
that function itself directly when the state it depends on changes, instead
of having it be called via on-demand.


On Fri, Oct 11, 2013 at 12:44 PM, Laurent <laurent.orseau at gmail.com> wrote:

> It's mostly working, except for a small display bug:
> After reordering the tabs, the displayed numbers of each tab for
> keybindings, like "1: MyFile.rkt" are not correctly updated, although the
> shortcuts themselves seems to be updated.
> I call `(update-menu-bindings)' at the end of the reordering.
> Do I need to call some other updating procedure beside that?
> The weird thing is that for `close-current-tab' it is correctly updated,
> but I don't see what makes that happen in that procedure...
> Laurent
> On Thu, Oct 3, 2013 at 6:16 PM, Laurent <laurent.orseau at gmail.com> wrote:
>> Thanks for the pointer and info, now I think I have a decent idea of how
>> to do it (but later).
>> Laurent
>> On Thu, Oct 3, 2013 at 6:03 PM, Robby Findler <
>> robby at eecs.northwestern.edu> wrote:
>>> I don't believe there is one, but I think that it should work to provide
>>> a 'reorder-tabs' method that, given some spec for a new order, adjusted the
>>> 'tabs' field and the content of the tabs-panel gui control (in the
>>> definition of frame-mixin in unit.rkt).
>>> Robby
>>> On Thu, Oct 3, 2013 at 10:50 AM, Laurent <laurent.orseau at gmail.com>wrote:
>>>> Hi,
>>>> Is there a method somewhere to reorder tabs in DrRacket, like a
>>>> `change-children' method?
>>>> I see a `get-tabs' method, but not a `set-tabs' one:
>>>> http://docs.racket-lang.org/tools/drracket_unit.html?q=get-tabs#%28meth._%28%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3aunit~3aframe~3c~25~3e%29._get-tabs%29%29
>>>> Thanks,
>>>> Laurent
>>>> ____________________
>>>>   Racket Users list:
>>>>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131011/fe11148d/attachment.html>

Posted on the users mailing list.