public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* font selection problem
@ 2003-03-25 10:49 Stan Pinte
  2003-03-28  0:12 ` Daniel Skarda
  0 siblings, 1 reply; 3+ messages in thread
From: Stan Pinte @ 2003-03-25 10:49 UTC (permalink / raw)
  To: guile-gtk; +Cc: guile-user

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@wanadoo.be

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-01 12:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-25 10:49 font selection problem Stan Pinte
2003-03-28  0:12 ` Daniel Skarda
2003-04-01 12:26   ` Stan Pinte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).