[racket] image on frame
Thanks for this example. I'm trying to load multiple 50x50 ".bmp" images
into a frame, specifying both the horizontal and vertical positions.
Specifying the horiz-margin for a message works fine, but the vert-margin
does not. Is this an error, or am I missing something? I'm using Racket 3.3.
Sample code:
#lang racket/gui
(define xmax 12)
(define ymax 10)
(define f (new frame% [label "This Space For Rent"]
[height (* 50 ymax)]
[width (* 50 xmax)]
[alignment '(left top)]
))
(define l (new message% [parent f]
[vert-margin 0]
[horiz-margin 0]
[label (make-object bitmap% "x.bmp")]))
(set! l (new message%
[parent f]
[vert-margin 0]
[horiz-margin 50]
[label (make-object bitmap% "y.bmp")]))
(set! l (new message%
[parent f]
[vert-margin 50]
[horiz-margin 0]
[label (make-object bitmap% "z.bmp")]))
(send f show #t)
-----Original Message-----
From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org]
On Behalf Of Michael Wilber
Sent: Tuesday, April 16, 2013 9:20 AM
To: deepak verma; users
Subject: Re: [racket] image on frame
Try something like:
#lang racket/gui
(require racket/draw)
(define f (new frame% [label "This Space For Rent"]))
(define l (new message% [parent f]
[label (make-object bitmap%
"/tmp/130414_005.jpg")]))
(send f show #t)
deepak verma <deepakverma14021994 at gmail.com> writes:
> how can we show a image on frame ?
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
____________________
Racket Users list:
http://lists.racket-lang.org/users