[racket] Extending the Racket GUI with native widgets
2011/1/5 Matthew Flatt <mflatt at cs.utah.edu>:
> At Wed, 5 Jan 2011 18:04:26 +0100, Thomas Chust wrote:
> [...]
>> And even if I manually resize, show and redraw the widget using calls
>> of wrapped GTK+ functions at the REPL, it still doesn't show up in the
>> GUI.
>
> Can you send an example?
> [...]
Hello Matthew,
thank you for your help!
An example is attached to this message. Open and run the module in
DrRacket, and try the following interactions:
;; Open a new frame% titled "Test" which contains a button-panel%
;; with an embedded native GTK+ button, return the panel object:
(define panel (go))
;; Determine the current allocated size of the button in the panel:
(send panel button-size)
;; Adjust the size of the GTK+ button embedded in the panel to that
;; of the panel and explicitly requests a redraw of the button:
(send panel button-resize+redraw)
On my machine running Linux and DrRacket version 5.0.99.6 the frame
appears empty all the time, even after explicitly requesting a resize
and redraw operation.
Even though on-size is overridden in the button-panel% class and
forwards the change of size to the native GTK+ button, the allocated
size of the button does not change if the window is resized.
Ciao,
Thomas
--
When C++ is your hammer, every problem looks like your thumb.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gtk-sample.rkt
Type: application/octet-stream
Size: 2036 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20110105/806dda2d/attachment.obj>