FAQ Database Discussion Community


How can I change the font size of a Gtk.Label in vala?

linux,gtk3,vala
I'm a Vala/Gtk newbie and I'm trying to change the font size of a Gtk.Label, but I can't find a good way to do it. I find out that I can use the markup like this : var welcome_message = new Gtk.Label ("<span size='17000'>Hello</span>"); welcome_message.set_use_markup (true); But it seems a...

Vala files import

linux,oop,vala
I have a problem when work with properties in separated files in Vala Language The Main.vala file is using Teste; using Cagado; static int main(string[] args) { GUI gui = new GUI(); stdout.printf("%d\n", gui.idade); return 0; } The HelloVala.vala is: namespace Teste { public class Person : Object { private...

How to generate the valadoc for a C library (or any library whose bindings ships with vala)?

documentation,vala,gobject-introspection
I want to re-generate the valadoc for the gnome gio-2.0 library (that is part of glib). I'm aware that the complete documentation is available online. I want to be able to generate it locally (ideally without having to rebuild the library myself). Valadoc is able to generate the documentation from...

How can I add a reference to a value-type in vala

memory-management,vala
In c++ I can add a reference to a value type, for example : int a = 12; int &b = a; a--; cout << "a = " << a << ", b = " << b << endl; Will give : a = 11, b = 11 Is there...

Chain up to 'Gtk.Box.new' not supported

oop,gtk,vala
I'm new to Vala and so far I think it's pretty cool but I'm having trouble understanding inheritance. I read here that I should use base() to call the parents constructor. Alright, cool, seems understandable but It din't work for me. I kept getting the error on the title. Here...

Easy object persistence in Vala (like shelve/pickle)

python,vala,gobject,object-persistence
I would like to transfer my code from Python to Vala, but i ran into problems. Is there an easy method to store objects created in Vala, like you can do it with pickle/shelve? I would like to avoid running an entire database....

Async Function in Vala - Yield & Callback

function,asynchronous,gtk,vala
I'm developing a project written in Vala and GTK +, I need to implement an asynchronous function, therefore I set out to make an example of test ... and for some reason I get the following error: async.vala:31.3-31.20: error: Access to async callback `asyncProc.callback' not allowed in this context asyncProc.callback...

libXML: check if node is already unlinked and freed

memory-management,xpath,libxml2,vala
I am parsing a html document with libxml2 and remove some elements based on xpath querys. For example I want to remove all elements that contain "display: none" with: stripNode(doc, "//*[contains(@style,'display:none')]"); ... public static void stripNode(Html.Doc* doc, string xpath) { Xml.XPath.Context cntx = new Xml.XPath.Context(doc); Xml.XPath.Object* res = cntx.eval_expression(xpath); if(res...

How to cast a compact type in Vala?

casting,vala
I am using the gobject-introspection-1.0 library from Vala to dynamically load gir modules. As I need to call an initialization function having a fixed name, I retrieve a BaseInfo object from Repository.find_by_name. Now, I want to invoke this function with GI.CallableInfo.invoke, which needs a GI.CallableInfo object. Luckily, GI.CallableInfo inherits from...

What does the “_” function in Vala do?

function,vala
I've seen that some projects used _ function that takes string as an argument, like _("Hello World"). But I couldn't find any manuals or articles about what is it and how to use it. I guess this has something to do with i18n and l10n (it was mentioned in some...