[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

font selection problem

From: Stan Pinte
Subject: font selection problem
Date: Tue, 25 Mar 2003 12:23:24 +0100


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,


resource file:

style "my-style"
        #fg[NORMAL] = "#aacccc"
        #font = "-adobe-helvetica-bold-*-*--*-*-*-*-*-*-*-*"
        font = "-misc-fixed-medium-r-normal--10-*-*-*-*-*-*-*"

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"


(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!")
                        (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

email:          address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]