This is the mail archive of the guile-gtk@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

font selection problem


hello,

I do not know if anyone has ever tried to set different fonts for labels, buttons, etc from a resource file, using guile-gtk.

Anyway, the "font" directives do not seem to have any impact on the font used by Gtk...

I am using guile-gtk-1.2.31, and guile-1.6.2 ...

the included test program should proof the fact...

Any ideas?

thanks a lot,

Stan.

resource file:

style "my-style"
{
	#bg[NORMAL]="#333"
	#fg[SELECTED]="#FFF"	
	#fg[NORMAL] = "#aacccc"
	#font = "-adobe-helvetica-bold-*-*--*-*-*-*-*-*-*-*"
	font = "-misc-fixed-medium-r-normal--10-*-*-*-*-*-*-*"
	#font="-adobe-helvetica-bold-*-normal-*-10-*-*-*-*-*-iso8859-*"
	#font="-adobe-courier-medium-i-normal-*-*-100-*-*-m-*-iso8859-1"
}

class "*GtkButton*" style "my-style"
#class "*GtkLabel*" style "my-style"
#class "*GtkEntry" style "my-style"
widget "*mybutton" style "my-style"
widget "*mylabel" style "my-style"

program:

(use-modules (gtk gtk))

(gtk-rc-parse "hellorc")

(let ((window (gtk-window-new 'toplevel))
      (vbox (gtk-vbox-new #f 0))
      (button (gtk-button-new-with-label "Say Hello"))
      (label (gtk-label-new "test")))
  (gtk-widget-set-name button "mybutton")
  (gtk-widget-set-name window "mywindow")
  (gtk-widget-set-name label "mylabel")
  (gtk-window-set-title window "Guile-Gtk: Hello World")
  (gtk-container-border-width window 10)
  (gtk-container-add vbox button)
  (gtk-container-add vbox label)
  (gtk-container-add window vbox)
  (gtk-signal-connect button "clicked"
		      (lambda () 
			(display "Hello World!")
			(newline)
			(gtk-widget-destroy window)))
  (gtk-widget-show-all window)
  (gtk-standalone-main window))

-- 

Stanislas Pinte

Computer Consultant

	98, rue Bois l'Evêque
	B-4000 Liège

web:		http://www.altosw.be
email:		alto_stan at wanadoo dot be


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]