1 Oct 2007 16:03
Re: Styles (was: A newbie need help)
Axel Simon <A.Simon <at> kent.ac.uk>
2007-10-01 14:03:37 GMT
2007-10-01 14:03:37 GMT
Dear Deng,
I tried your example and sure enough it doesn't work as expected. I
tried to understand the (really bad) documentation and came up with
the following:
> windowXml <- xmlNew "myStyle.glade"
> let window = case windowXml of
> (Just window) -> window
> Nothing -> error "Can't read glade file!"
>
> winMain <- xmlGetWidget window castToWindow "winMain"
> btnStyle <- xmlGetWidget window castToButton "btnStyle"
>
> widgetSetName winMain "winMain"
> widgetSetName btnStyle "btnStyle"
>
a) You've already named you widgets in the .glade file, so you don't
need to use the functions widgetSetName.
> then this is my .gtkrc-2.0 file:
> style "mySize" {
> GtkButton::default_outside_border = { 10, 10, 10, 10 }
> }
> widget "btnStyle" style "mySize"
The property "default_outside_border" only works if the button has
the "CAN_DEFAULT" flag set. AFAIK this means the button must be the
default button of a dialog box. I think you can set this flag using
(Continue reading)
RSS Feed