[plt-scheme] some GUI questions

From: Robby Findler (robby at cs.uchicago.edu)
Date: Tue Jun 27 20:12:33 EDT 2006

At Tue, 27 Jun 2006 16:30:07 -0700, Dave Herman wrote:
> Hi,
> I'm still not very good at GUI programming with MrEd and the DrScheme 
> extension toolkit. I'm trying to implement a "debugging console" for my 
> JavaScript language level that instruments the inner workings of the 
> compiler and runtime for the curious user. But I'm sort of struggling. 
> Here are some of my questions:
> - Is it possible to extend the menus of a language level? I see the 
> capability-value facility allows me to disable some of the default ones, 
> but can I add new ones? I'd like to add a "Display/Hide JavaScript Debug 
> Console" item.
> - Is it possible to change the fonts of a text% or editor-canvas%?

Yes, in a text%. See change-style.

> - What is the proper way to handle the console's state? It should 
> ideally persist across multiple executions of a definitions window, but 
> there should be a separate console for each tab/window. Where would this 
> live? should there be a console field in the tool@ unit, in the 
> language<%> class instance, in a parameter...?

You want to add a tab mixin and store the state on a field there, it
sounds like. Search for "drscheme:" and "tab" in Help Desk.

Have your instrumentation close of drscheme's eventspace and use
queue-callback to send information back to the window. It is easiest to
only make modifications to the window from a single thread and it seems
likely that you want that thread to the eventspace handler thread for
the window (ie, the thread that services other callbacks, like resizes,
button clicks, etc).

> If it lives in a parameter, which thread should the parameter be 
> attached to? The mzscheme eventspace of on-execute, or the user 
> eventspace exposed by the run-in-user-thread argument? I started 
> experimenting, but then when I hit "Execute" a second time it caused 
> DrScheme to hang, at which point I decided to take a break. :)
> Thanks,
> Dave
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.