jverzani / gWidgets2

Rewrite of gWidgets
35 stars 9 forks source link

svalue(gbutton_obj) <- "asdf" drops font attributes #65

Closed landroni closed 10 years ago

landroni commented 10 years ago

This seems related to #51.

Consider this:

w <- gwindow("Buttons", visible=T)
g <- ggroup(cont=w, horizontal=FALSE)
b1 <- gbutton("open", cont=g)
font(b1) <- list(weight = "bold")

Now:

 svalue(b1) <- "open1"

Notice that both the icon and the formatting disappears. I would have expected both to be preserved; well, if not the icon, at the very least the bold formatting should be preserved. Is this intended behaviour or a bug?

jverzani commented 10 years ago

It turns out to be a hassle to keep the font information. The underlying widgets don't do this, so I never thought to implement it, and likely won't. With Gtk you can provide the text using PANGO markup, very similar to HTML. With Qt you can use HTML. The tcltk widgets are not so easy.

landroni commented 10 years ago

I see. But is it possible to retrieve current font information? I try font(b1), but it doesn't seem to retrieve anything (although the docs suggest it should). Am I doing it wrong?