Re: [Vala] Question about some wiki content

2014-01-15 Thread Jonas Kulla
2014/1/15 Steven Oliver > The decrement inside the IF is permanent? Even if the IF statement > evaluates to false? > > public void down () { > if (--ref_count == 0) { > delete (void*) this; > } > } > > Steven N. Oliver Yes, this is basic C syntax: http://en.wikip

Re: [Vala] Access GTKText

2014-01-14 Thread Jonas Kulla
2014/1/14 Gilzad Hamuni > Hi list, > > I've compiled and tested this C-tutorial that shows how to have different > fonts, colors and and sizes in a single text box: > http://www.gtk.org/tutorial1.2/gtk_tut-14.html > > GtkWidget *text; > ... > text = gtk_text_new (NULL, NULL); > ... > fixed_font =

Re: [Vala] Problem creating VAPI file for XcbIcccm (extra data)

2013-12-12 Thread Jonas Kulla
2013/12/12 rastersoft > BTW: The whole VAPI file is this: > > using Xcb; > > [CCode (lower_case_cprefix = "xcb_icccm_", cheader_filename = > "xcb/xcb_icccm.h")] > namespace XcbIcccm { > > public Xcb.GetPropertyCookie get_wm_class(Connection conn, Window > window); > public Xcb.GetProperty

Re: [Vala] Properties == GObject properties?

2013-10-11 Thread Jonas Kulla
2013/10/11 Tal Hadad > > Of course you would have to _declare_ the 'notify' signal. > I suppose that by "declare" you mean invoking notify("property") > inside the setter. > > No, I mean declaring it such as: class Foo { public signal void my_prop_notify(int value); } Jonas

Re: [Vala] Properties == GObject properties?

2013-10-11 Thread Jonas Kulla
2013/10/11 Tal Hadad > > Hi, > > > > On Fri, Oct 11, 2013 at 9:34 AM, Tal Hadad wrote: > > > First time I hear not all properties are GObject. > > > > > > Suppose I have this property: > > > > > > ... > > > public int 1numbered { get; set; } > > > ... > > > > > > This is not a GObject property,

Re: [Vala] How to change Gtk.IconView background color

2013-09-07 Thread Jonas Kulla
2013/9/4 David Siewert > Hi, > i am trying to change the background color of Gtk.IconView > > normally i would do it with: > .override_background_color(Gtk.StateFlags.NORMAL,color); > but it doesn't work that way... > > is there i a better/working or obvious way of doing it, that i have missed?

Re: [Vala] Private variable/function/class

2013-07-15 Thread Jonas Kulla
2013/7/15 Ulink > Hi, > > If I'm declaring a private variable/funtion/class and compile it to a > "package" (.so), it is not shown up in the .h and .vapi, this is ok. > > However, all this symbols ARE exported in the .so symbol table! > > If one bind more than one .so with e.g. the same PRIVATE v

Re: [Vala] Why does a simple struct need a special copy function?

2013-07-12 Thread Jonas Kulla
2013/7/12 Nadav Vinik > > > On 6 July 2013 22:06, Jonas Kulla wrote: > >> >> >> >> 2013/7/6 Nadav Vinik >> >>> >>> >>> On 6 July 2013 11:15, Jonas Kulla wrote: >>> >>>> >>>> >

Re: [Vala] Why does a simple struct need a special copy function?

2013-07-06 Thread Jonas Kulla
2013/7/6 Nadav Vinik > > > On 6 July 2013 11:15, Jonas Kulla wrote: > >> >> >> >> 2013/7/6 Nadav Vinik >> >>> Hello >>> >>> I get an error: >>> undefined reference to `pcap_packet_header_copy' >>> >

Re: [Vala] Why does a simple struct need a special copy function?

2013-07-06 Thread Jonas Kulla
2013/7/6 Nadav Vinik > Hello > > I get an error: > undefined reference to `pcap_packet_header_copy' > > why can't vala copy? it's not only allocate memory of size of the struct > and copy it to it? > > > struct pcap_pkthdr { > struct timeval ts;/* time stamp */ > bpf_u_int32 caplen;

Re: [Vala] How to prevent gee.HashMap.set from copy the memory and only return the pointer?

2013-07-02 Thread Jonas Kulla
2013/7/2 Nadav Vinik > Hello > > when I try to set an object to HashMap gee.HashMap.set try to copy the > memory of it with _vala_array_dup1 and it not allowed in my case. > > public class pcapNode { > public uchar[] packet; > public PCap.packet_header* header; > } > > var node = new pcap

Re: [Vala] Why can't I use Gee.HashMap as a class property?

2013-07-01 Thread Jonas Kulla
2013/7/1 Nadav Vinik > Hello > > I I use HashMap as a property I get error: > c.vala:26.3-26.5: error: missing generic type arguments > map[1] = node; > ^^^ > > how should I use gee.HashMap as a property to share it between classes? > > b.vala compile while c.vala not. > > thanks

Re: [Vala] would like to eliminate compilation warning related to stripping whitespace from elements of a string []

2013-06-21 Thread Jonas Kulla
2013/6/21 Reid Thompson > > how do I implement the following to make the compilation warnings go > away? > > $ cat readMDF.vala > /*valac --pkg gio-2.0 gio-sample.vala*/ > > > int main (string[] args) { > // A reference to our file > var file = File.new_for_path (args[1]); > > if (!fi

Re: [Vala] Use alpha in GtkColorButton in GTK3 with Vala

2013-06-01 Thread Jonas Kulla
2013/6/1 Satyajit Sahoo > I want to use an alpha value in the color buttons in my app - > https://github.com/satya164/elegance-colors > > Currently I'm using colorbutton.set_use_alpha (true);, as documented in > http://www.valadoc.org/#!api=gtk+-3.0/Gtk.ColorButton > > But, while compiling, I get

Re: [Vala] Vala and Cairo 1.12

2013-05-18 Thread Jonas Kulla
2013/5/15 Donn > > Are there a lot of new functions in 1.12 that you need? If not, >> you could just inline the function signatures in your vala code >> until someone updates the official vapi. >> > It seems Evan Nemerson is on the case - yay! - but I'd like to know a > little more about this inl

Re: [Vala] memory management with structs (OT a bit)

2013-05-18 Thread Jonas Kulla
2013/5/18 Donn > On 18/05/2013 13:40, Jonas Kulla wrote: > >> no, compact classes are even simpler than non-Gobject classes. The >> latter still have reference count and can be extended, whereas >> compact classes are mostly "classified" structs without ref coun

Re: [Vala] memory management with structs (OT a bit)

2013-05-18 Thread Jonas Kulla
2013/5/18 Donn > On 18/05/2013 12:15, Luca Bruno wrote: > >> You can use classes that don't inherit from GObject, which are lighter. >> > Are such classes the [Compact] classes, or is any class that does not > specify a parent class automatically a "light" class? > > Hi, no, compact classes are

Re: [Vala] Vala and Cairo 1.12

2013-05-14 Thread Jonas Kulla
2013/5/14 Donn > Hi, > Vapi files mystify me. Does anyone know where I can get a vapi (and > anything else I'd need) such that I can use Cairo 1.12? > > Or, perhaps someone can help me generate it? > > BTW - The valadoc.org/cairo seems to be about version 1.0 of cairo - so > it's also out of date

Re: [Vala] Gtk+ -mwindows

2013-05-11 Thread Jonas Kulla
2013/5/11 Stamper > Hello! > > I learn Vala now. I use win32 binaries from http://www.tarnyko.net/en/?q=* > *node/13 and Geany as IDE. > I'm trying to develop simple Gtk UI application. But I want to hide > windows promt console. I've found this: > http://st

Re: [Vala] Using uninitialized Glib.TimeVal

2013-04-14 Thread Jonas Kulla
2013/4/14 Alexander Krivács Schrøder > Hi. > > I'm trying to use Glib.TimeVal with its from_iso8601() initializer, but > I can't get the generated C code not to contain a call to > g_get_current_time() first. At first, I tried this Vala code: > > string iso8601_date = "1999-05-31T11:20:00"; > Tim

Re: [Vala] Autovala: new program for developers

2013-04-13 Thread Jonas Kulla
2013/4/14 Francis Giraldeau > > I have some problem to compile configuration.vala, seems related to Posix: > > > /home/francis/workspace-vala/autovala/src/autovala_lib/configuration.c:2264:2: > error: too many arguments to function ‘realpath’ > > Here is the generated C code: > > _tmp35_ = realpat

Re: [Vala] LDAP-Access with vala

2013-03-21 Thread Jonas Kulla
2013/3/21 Richard Wiedenhöft > Hi, > > I searched valadoc and google and I found absolutely nothing usable. > > How can one bind to an LDAP-Server with Vala and read the entries. > > Thank you in advance > > -- > Richard Wiedenhöft > > > ___ > vala-list

Re: [Vala] class constructor not being called

2013-03-16 Thread Jonas Kulla
2013/3/16 Albert Hopkins > > > On Sat, Mar 16, 2013, at 12:15 PM, Jonas Kulla wrote: > [...] > > Hi, > > > > Your function 'noop()' is declared static, hence no instance is required > > to > > call it. > > Class constructors are called

Re: [Vala] class constructor not being called

2013-03-16 Thread Jonas Kulla
2013/3/16 Albert Hopkins > I'm trying to understand why class constructors are not being called. > According to the docs: > > class-class-constructor-declaration: > class construct { statement-list } > This block will be executed once at the first use of its class, and once > at the first

Re: [Vala] realpath compiles incorrectly

2013-03-13 Thread Jonas Kulla
2013/3/13 rastersoft > Hi all: > > I'm trying to use Posix.realpath, but I'm unable, because Vala seems to > compile it incorrectly. I receive this message: > > .vala.c:920:2: error: too many argument for function ‘realpath’ > > I put in my code: > > string tmp; > tmp=Posix.realpath(this.config_p

Re: [Vala] Widgets hierarchy, or how get label on the bix?

2012-12-31 Thread Jonas Kulla
2012/12/31 Александер Пономарёв > Hi all, > please, tell me somebody, is possible in the vala to get access to one > widget trough another one? > To be clear: I have a box and one label on it: > > var box = new Box(...); > var label = new Label(...); > box.pack_start(label, ...); > >

Re: [Vala] Defining new virtual signal is possible, but overring it isn't.

2012-12-17 Thread Jonas Kulla
2012/12/17 Tal Hadad > public class Foo : GLib.Object { > public virtual void func() { > } > > internal static void bug () { > new Bar (); > } > } > public class Bar : Foo { > public override void func() { > } > } > I just tried compiling this with Vala 0.18 too a

Re: [Vala] vala-list Digest, Vol 61, Issue 7

2012-12-17 Thread Jonas Kulla
2012/12/17 JM > Interesting. But this feature seems undocumented, I cannot find it in > the tutorial. > > > Am Sonntag, den 16.12.2012, 20:20 +0100 schrieb Jonas Kulla: > > 2012/12/16 JM > > > > > Overriding a signal or making it virtual does not really make

Re: [Vala] vala-list Digest, Vol 61, Issue 7

2012-12-16 Thread Jonas Kulla
2012/12/16 JM > Overriding a signal or making it virtual does not really make sense, > does it? > A signal does not have a body, as a function would have and signature is > always the same, even in child classes. > > > Also your example seems weird, as you have bodys for signals. > > Regards > N

Re: [Vala] Need help to make binding for typedef'd pointer struct

2012-10-19 Thread Jonas Kulla
2012/10/3 Ahmad Syukri bin Abdollah > Greetings! > > Not long ago, someone made a binding for GMP > (https://mail.gnome.org/archives/vala-list/2011-August/msg00048.html) > and posted it on the wiki, but it seems to have been lost. > I'm attempting to write a new one, but came across some design >

[Vala] valac: output symbols without compiling

2012-09-26 Thread Jonas Kulla
Hi list! Valac offers the option '--symbols=FILE', which is very handy in that it writes all public C symbols in an easy to parse file. I'm using it to generate a version script for passing to ld. However, right now I have to compile my library just to get this symbols file, which means I have to

Re: [Vala] Rv: C to Vala

2012-09-20 Thread Jonas Kulla
2012/9/20 Mario Daniel Ruiz Saavedra > What hinders it from making it the other way (taking c code which heavily > uses GLib, and turning it into Vala Code)? > The same thing that hinders an oven from producing flour and water from bread I suppose. __

Re: [Vala] run the metho1 from the method2 of class2

2012-09-11 Thread Jonas Kulla
2012/9/11 "Luis L. Rodríguez Oro" > Hi all, please help me. > > what is the best way to run the metho1 from the method2 of class2. I need > to change the interface from the class2. This example is illustrative only. > > Please help me. > > class main_window: Window{ >private Entry obj_entry;

Re: [Vala] Namespaces and Compiling With Multiple Source Files

2012-09-10 Thread Jonas Kulla
2012/9/10 Landon Blake > I'm trying to compile and run a Vala program from two (2) vala source > files. I can compile the program with the following command: > > valac geospatial_annotations.vala sutiv.vala -o > test_geospatial_annotations.vala > > The sutiv.vala file contains the namespace "Suti

Re: [Vala] Convert RGB color value to HEX

2012-09-03 Thread Jonas Kulla
2012/9/3 Satyajit Sahoo > Hi. I need to get color value in HEX in my vala program. > > Basically, I get a color expression like this, > > rgb(red, green, blue) or rgba(red, green, blue, alpha) > > But I need to convert it into a format #rrggbb > > I cannot seem to understand how to do it. > usi

Re: [Vala] sqlheavy?

2012-07-02 Thread Jonas Kulla
> Hi everyone, > I need to use sqlite in my app. Does anyone have any experience using the > sqlheavy wrapper? Does it make working with sqlite in Vala more friendly in > your experience? Is it kept up to date? > thanks Did you read this document[1]? Seemed pretty "user"-friendly to me, although