[plt-scheme] Styling MrEd GUI components
Hey All,
I went ahead and took a first pass at implementing a canvas-panel% -- which
is a panel I can add window components to (like buttons) and is also a
canvas%, so I can draw on the background of it.
For now, it's only useful for drawing borders around the components, but I
may do more with it in the future.
You can see the code (and perhaps recommend ways to improve it?) here:
http://benjisimon.blogspot.com/2008/04/more-adventures-in-creating-mred.html
This component would be even more useful if there was some way to control
the background color of the inidividual window components (turning it from
gray to some other component). There isn't a way to do this, is there?
Even if it was some low level hack type thing, I might still want to do it,
just to make it so that I could mix canvases and components more easily.
On Sun, Mar 30, 2008 at 10:00 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sun, 30 Mar 2008 00:49:16 -0400, "Ben Simon" wrote:
> > On Mon, Mar 10, 2008 at 9:22 AM, Matthew Flatt <mflatt at cs.utah.edu>
> wrote:
> >
> > > At Sun, 9 Mar 2008 23:45:03 -0400, "Ben Simon" wrote:
> > > > How do I style MrEd components? That is, how could I make a button
> red,
> > > or a
> > > > border green? I see where I can make use of different fonts, but
> that's
> > > > about all I see in terms of controlling the Look & Feel of the
> > > components.
> > > [...useful comments trimmed]
> > >
> >
> >
> > >
> > > More generally, you can derive a sub-class of `canvas%' and draw
> > > anything as a control.
> > >
> >
> > There doesn't happen to be a way to use this approach, and somehow embed
> a
> > container like a vertical-panel% in the resulting canvas%, is there?
>
> No. That's something I've wanted to add, but I've never found the time
> to make it work.
>
> > The idea being that I might make a component that uses a canvas to draw
> a
> > green border, and then embed other GUI components (say, a series of
> buttons)
> > in this newly drawn area.
>
> I can think of a hack: create four canvases, place one on each side of
> the panel, and draw a border using all four canvases.
>
> Matthew
>
>
--
Have an idea for software? I can make it happen -
http://www.ideas2executables.com
My Blog: http://benjisimon.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080416/a1147fae/attachment.html>