Re: [Vala] [Genie] Help me please !



Nicolas wrote:
Hi,

I'm using this function:

       newfont = new FontSelectionDialog("Select font:")
       var response = newfont.run()
       if response is ResponseType.OK
           font_desc = new FontDescription()
           font_desc.from_string(newfont.get_font_name())
           text_view.modify_font(font_desc)
           newfont.destroy()
       if response is ResponseType.CANCEL
           newfont.destroy()

My problem is "font_desc" always return "Normal", what's wrong with my
code ?

Thanks in advance,
Nicolas.

Hi,

you're using a static method on an instance.

try
  font_desc = FontDescription.from_string(newfont.get_font_name())
instead of
  font_desc = new FontDescription()


Best Regards,

Frederik




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