[plt-scheme] scheme/gui: bitmaps in containers

From: Peter Ngo (pngo23 at gmail.com)
Date: Wed Mar 18 05:26:42 EDT 2009

Thanks for your reply,
I'll look into it. I thought of doing my own "buttoons" with a normal
canvas. Tracking the mouse coordinates and call my function when it is
within the boundaries of my "bitmap buttons".


2009/3/17 Matthew Flatt <mflatt at cs.utah.edu>:
> At Mon, 16 Mar 2009 21:05:14 +0100, Peter Ngo wrote:
>> During which I was trying to create a user menu with some buttons on a
>> canvas (with bitmap background). Obviously, it didn't work since the
>> buttons can't be created in a canvas.
>> So I tried to look for containers which would accept any bitmap as a
>> background. But I could only find (set-background-color) or similar
>> functions.
>>
>> Any ideas?
>
> The GUI toolbox doesn't directly drawing on button containers.
>
> It may be possible to implement a subclass of `panel%' that contains a
> canvas plus some buttons, and that overrides `place-children' to place
> the buttons and the canvas in the same place so that the buttons draw
> over the canvas. I doubt that it will work consistently on all
> platforms, though.
>
> Another possibility is the `embedded-gui' library, which implements
> some controls to go inside an `editor<%>', and you can also override
> the `on-paint' method of an `editor<%>' to draw the background. The
> `embedded-gui' library doesn't use the platform widgets at all, so you
> don't get the same look-and-feel.
>
>


Posted on the users mailing list.