racket/gui gtk: preserve button font on label change

This commit is contained in:
Matthew Flatt 2013-04-25 06:04:41 -06:00
parent 62f74cda0e
commit 306194e9fa

View File

@ -118,10 +118,12 @@
(define/override (get-label-gtk)
(gtk_bin_get_child (get-client-gtk)))
(define the-font font)
(define/override (set-label s)
(cond
[(string? s)
(gtk_button_set_label gtk (mnemonic-string s))]
(gtk_button_set_label gtk (mnemonic-string s))
(when the-font (install-control-font (get-label-gtk) the-font))]
[else
(let ([pixbuf (bitmap->pixbuf s)])
(atomically