Re: [Vala] Vala in Python - Some progress and a question

2013-04-20 Thread Sam Wilson
On 13-04-20 07:40 AM, Donn wrote: > Question > > Why are the various stdout.printf calls not working straight away? When > the app is closed they all print - as if they were stored in some > off-screen buffer someplace. I could be mistaken, but python uses line buffering, so if you put a

Re: [Vala] Request for new keyword "nobreak"

2013-01-24 Thread Sam Wilson
n a switch statement is embedded inside a loop. > >-- Jim > >On Thu, Jan 24, 2013 at 1:20 PM, Sam Wilson >wrote: >Why not something like continue? > >"Nelson, Jim" wrote: >Apparently this is possible in C# with the "goto case " syntax: > >

Re: [Vala] Request for new keyword "nobreak"

2013-01-24 Thread Sam Wilson
Why not something like continue? "Nelson, Jim" wrote: >Apparently this is possible in C# with the "goto case " syntax: > >http://stackoverflow.com/questions/174155/switch-statement-fallthrough-in-c > >Doesn't work in Vala, however. > >I'm not advocating for switch-case fallthrough, but C# was ab

Re: [Vala] printing int64 value to standard output

2012-05-15 Thread Sam Wilson
On 12-05-15 06:54 AM, pancake wrote: %lld is not portable. your code will not work on windows. the portable way is: void main() { uint64 ts = 123; stdout.printf ("%"+uint64.FORMAT_MODIFIER;+"d\n", ts); } That just looks horrible... Couldn't Vala just compile %lld into the proper format on ea

Re: [Vala] How to ignore exceptions?

2011-10-30 Thread Sam Wilson
Perhaps a better way to do this is like this: string[] test = new string[3]; for (int i = 0; i < 3; i++) { try { test[i] = kf.get_string(group, key); } catch (KeyFile.Error error) { // Do nothing } } if (!test[0] && !test[1] && !test[3]) return false; What

Re: [Vala] [VALA] as playing a wav file with vala and is cross platform.

2011-10-26 Thread Sam Wilson
Hello Edwin, If I remember correctly, gstreamer [0] is cross platform and has vala bindings. Maybe it could be useful for you? Sam --- [0] http://gstreamer.freedesktop.org/download/ On 11-10-26 10:16 AM, Edwin DLCA wrote: Best regards. Is there any way to use a library to play audio f

Re: [Vala] Dova Object Questions

2010-09-22 Thread Sam Wilson
Sam Wilson writes: > In the weak_get method I noticed that it increments the > ref_count variable instead of the weak_count variable. > Why is that? Okay, I understand the weak_get now, it converts a weak reference to a strong reference so it can be used

[Vala] Dova Object Questions

2010-09-22 Thread Sam Wilson
Hey! I was just taking a look through the dova-core repo, when a few things roused my curiosity. In the weak_get method I noticed that it increments the ref_count variable instead of the weak_count variable. Why is that? The comment mentions that you successfully obtained a strong reference, wh

Re: [Vala] [PATCH] Moving functions between Classes in Metadata files

2010-08-20 Thread Sam Wilson
Sam Thursfield writes: > > On Sun, Jul 11, 2010 at 10:46 PM, tecywiz121 wrote: > > Hey! ... > > My solution was to add a new property to vapigen called "belongs_to"  It > > allows a function to be moved into a different class/struct/enum.  It > > also tries to fix up the vala name by removing t

Re: [Vala] non-null broken in vala 0.9.3

2010-07-16 Thread Sam Wilson
Jiří Zárevúcky writes: > > tecywiz121 píše v Čt 15. 07. 2010 v 23:06 -0400: > > > > Bringing static code analysis would be amazing, but I have a feeling > > that detecting when a variable is considered safe is an undecidable > > problem (http://en.wikipedia.org/wiki/Undecidable_problem ). Not

Re: [Vala] Singleton and reference count

2010-04-29 Thread Sam Wilson
On Thu, 2010-04-29 at 18:55 +0200, Jan Hudec wrote: > Hello, > > On Wed, April 28, 2010 13:46, Jan Niklas Hasse wrote: > > On Wed, Apr 28, 2010 at 11:31 AM, pancake wrote: > >> On Apr 28, 2010, at 10:24 AM, Jan Niklas Hasse wrote: > > > > So shouldn't Vala unref namespace scoped variables when l

Re: [Vala] Singleton and reference count

2010-04-27 Thread Sam Wilson
On Tue, 2010-04-27 at 19:42 +0200, Jiří Zárevúcky wrote: > Jonh Wendell píše v Út 27. 04. 2010 v 10:46 -0300: > > Hi, folks. I wrote a simple singleton: > > > > And in the other file, I do: > > > > var prefs = Prefs.default (); > > use prefs var... > > > > The prefs var doesn't get destroye

Re: [Vala] Singleton and reference count

2010-04-27 Thread Sam Wilson
On Tue, 2010-04-27 at 10:46 -0300, Jonh Wendell wrote: > Hi, folks. I wrote a simple singleton: > > public class Prefs { > private static Prefs instance; > > public static Prefs default() { > if (instance == null) > instance = new Prefs (); > > return instance; > } > > pri

[Vala] Clutter gradient and text

2010-04-21 Thread Sam Wilson
Hello, I hate to bother you all with trivial stuff like this, but I am having some serious trouble finding the error in my program. Essentially, I want to render a shape with a gradient background and a text label, so I created an actor that has a single Text actor as a child. The gradient is ren

Re: [Vala] [Fwd: Re: 2D Static Array]

2010-04-20 Thread Sam Wilson
On Tue, 2010-04-20 at 14:55 +0200, JM wrote: > > public static int main() { > > var y = new Matrix({{ 2.0, 3.0, 4.0, 5.0}, > > { 2.0, 3.0, 4.0, 6.0}, > > { 2.0, 3.0, 4.0, 7.0}, > > { 2.0, 3.0, 4.0, 8.0}}); > > print("ge

Re: [Vala] Problem binding lasem-0.2

2010-04-14 Thread Sam Wilson
On Wed, 2010-04-14 at 22:39 -0400, Sam Wilson wrote: > On Wed, 2010-04-14 at 16:33 -0700, Evan Nemerson wrote: > > It looks like lasem is missing gdk-pixbuf-2.0 in the Requires section of > > its pkg-config file. > > Seemed to be the problem, vala-gen-introspect just ran and

Re: [Vala] Problem binding lasem-0.2

2010-04-14 Thread Sam Wilson
On Wed, 2010-04-14 at 16:33 -0700, Evan Nemerson wrote: > It looks like lasem is missing gdk-pixbuf-2.0 in the Requires section of > its pkg-config file. Seemed to be the problem, vala-gen-introspect just ran and made a gi file, now to continue with binding... Sam smime.p7s Description: S/MIME

Re: [Vala] Problem binding lasem-0.2

2010-04-14 Thread Sam Wilson
On Wed, 2010-04-14 at 22:13 +0200, Emmanuel Pacaud wrote: > That's why I've added gobject-introspection in master. You may want to > try to use the generated gir file. I didn't try to use it from vala, so > it may not work... Just downloaded master, but the configure script is spitting an error:

[Vala] Problem binding lasem-0.2

2010-04-14 Thread Sam Wilson
Hello again :) I'm trying to generate some vala bindings for lasem-0.2 [http://blogs.gnome.org/emmanuel/category/lasem/] and I am running into some errors. I've tried adding the missing files to lasem-0.2.files but it just explodes with more errors, so this is the output from my first attempt. H

Re: [Vala] Compile failed on .gir file

2010-04-14 Thread Sam Wilson
On Wed, 2010-04-14 at 18:18 +0200, Geert Jordaens wrote: > /* > valac -o G --pkg Gee-1.0 G.vala > */ > > using GLib; > using Gee; > > class ElementType : GLib.Object { > private uint _hash; > private string _body; > private string _name; >

Re: [Vala] Compile error when using Cogl.Color

2010-03-31 Thread Sam Wilson
> Date: Wed, 31 Mar 2010 10:43:29 +0100 > From: a.kito...@gmail.com > To: mhorde...@gmail.com > CC: vala-list@gnome.org > Subject: Re: [Vala] Compile error when using Cogl.Color > > Hi, > > 2010/3/29 Mike Hordecki : > > Hello! > > > > I've got a following problem with my the compiler. > > > >

Re: [Vala] IDE ?

2010-03-16 Thread Sam Wilson
he Valencia plugin here too > > > > On 16 March 2010 13:36, Sam Wilson wrote: > > > On Tue, 2010-03-16 at 05:30 -0700, Rob Powell wrote: > > >> I'm using Valencia with gedit. > > > > > > Seconded! > > > > > > I use it with waf a

Re: [Vala] IDE ?

2010-03-16 Thread Sam Wilson
On Tue, 2010-03-16 at 05:30 -0700, Rob Powell wrote: > I'm using Valencia with gedit. Seconded! smime.p7s Description: S/MIME cryptographic signature ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

[Vala] Valac generates bad C code for certain inheritance chains

2010-03-15 Thread Sam Wilson
Valac generates C code that does not compile for the attached example. I don't think that the example is supposed to compile, but I am pretty sure that valac should be outputting the error and not cc. I have absolutely no experience with C, so I can't make heads or tails of the compiler output tho

[Vala] Simple Clutter Widgets

2010-03-15 Thread Sam Wilson
Hey! So I finally decided to publicly publish what I've been working on for the past little while, a collection of simple Clutter widgets and a theming system for them. If anyone would like to take a look, its available on gitorious [1] I'd really appreciate any comments or criticisms anyone has

Re: [Vala] Cogl.PangoFontMap is undeclaired

2010-03-14 Thread Sam Wilson
On Sun, 2010-03-14 at 18:55 -0400, Sam Wilson wrote: > On Sun, 2010-03-14 at 18:32 -0400, Sam Wilson wrote: > > On Sat, 2010-03-13 at 18:24 -0800, Evan Nemerson wrote: > > > Without more information, or a test case, it's difficult to say for > > > sure. I'v

Re: [Vala] Cogl.PangoFontMap is undeclaired

2010-03-14 Thread Sam Wilson
On Sun, 2010-03-14 at 18:32 -0400, Sam Wilson wrote: > On Sat, 2010-03-13 at 18:24 -0800, Evan Nemerson wrote: > > Without more information, or a test case, it's difficult to say for > > sure. I've attached a patch which will include cogl-pango.h for all the > > Cog

Re: [Vala] Cogl.PangoFontMap is undeclaired

2010-03-14 Thread Sam Wilson
On Sat, 2010-03-13 at 18:24 -0800, Evan Nemerson wrote: > Without more information, or a test case, it's difficult to say for > sure. I've attached a patch which will include cogl-pango.h for all the > CoglPango* structures. Let me know if this fixes your issue. > > -Evan > > > That worked fin

Re: [Vala] Cogl.PangoFontMap is undeclaired

2010-03-14 Thread Sam Wilson
On Thu, 2010-03-11 at 12:46 -0500, Sam Wilson wrote: > I can't seem to get valac to output code that will compile when I am > working with Cogl.PangeFontMap. > > The relevant errors: > > PixmapThemeEngine.vala:31: error: ‘CoglPangoFontMap’ undeclared (first > use i

Re: [Vala] Can't compile ValaIde from source...

2010-03-12 Thread Sam Wilson
On Fri, 2010-03-12 at 18:24 +0200, Arkadi Viner wrote: > When I try to compile ValaIDE from source, It writes me: > ark...@arkadi-laptop:~/Projects/valide-0.6.1$ ./waf configure > Checking for program gcc : ok /usr/bin/gcc > Checking for program cpp : ok /usr/bin/cp

[Vala] Cogl.PangoFontMap is undeclaired

2010-03-11 Thread Sam Wilson
I can't seem to get valac to output code that will compile when I am working with Cogl.PangeFontMap. The relevant errors: PixmapThemeEngine.vala:31: error: ‘CoglPangoFontMap’ undeclared (first use in this function) Am I forgetting a pkg directive I don't know about? Thanks, Sam smime.p7s Desc

[Vala] Properties defined by mixins do not appear in list_properties

2010-03-05 Thread Sam Wilson
Not sure if this is intended behaviour or not, but properties defined by mixins do not seem to appear in the class's list_properties method. attached is some rather useless code that demonstrates this behaviour. Rather off topic: I know that most (if not all) of my posts to this list are about t

Re: [Vala] Converting nullable to non-nullable types

2010-02-26 Thread Sam Wilson
On Fri, 2010-02-26 at 11:22 +0100, Abderrahim Kitouni wrote: > hi, > > 2010/2/26, Sam Wilson : > > Hey! > > > > I am just wondering if there is any syntactic sugar for shortening the > > following code segment > > > > [code] > > Element? ns

Re: [Vala] Converting nullable to non-nullable types

2010-02-26 Thread Sam Wilson
On Fri, 2010-02-26 at 15:06 +0100, Jiří Zárevúcky wrote: > Sam Wilson píše v Čt 25. 02. 2010 v 21:43 -0500: > > Looks great, but I can't get it to compile with experimental non null > > since the ?? operator is returning an 'int?' > > > > That's

Re: [Vala] Converting nullable to non-nullable types

2010-02-26 Thread Sam Wilson
On Fri, 2010-02-26 at 15:08 +0100, Jiří Zárevúcky wrote: > Sam Wilson píše v Čt 25. 02. 2010 v 21:58 -0500: > > > > Would this also be a valid way to check for null? > > > > > > T unbox(T? v, string str) > > { > > if (v == null)

Re: [Vala] Converting nullable to non-nullable types

2010-02-25 Thread Sam Wilson
> Here's a little trick you might like: > > [code] > > errordomain MyError { > FAILED; > } > > T throwerror (string str) throws Error { > throw new MyError.FAILED (str); > } > > int func () > { > int? i = null; > int j = i ?? throwerror ("hello"); > return j; > } >

Re: [Vala] Converting nullable to non-nullable types

2010-02-25 Thread Sam Wilson
On Fri, 2010-02-26 at 00:43 +0100, Jiří Zárevúcky wrote: > > Here's a little trick you might like: > > [code] > > errordomain MyError { > FAILED; > } > > T throwerror (string str) throws Error { > throw new MyError.FAILED (str); > } > > int func () > { > int? i = null; >

[Vala] Converting nullable to non-nullable types

2010-02-25 Thread Sam Wilson
Hey! I am just wondering if there is any syntactic sugar for shortening the following code segment [code] Element? nsource = ElementFactory.make("filesrc", "file-source"); if (nsource == null) { printError(); return; } Element source = (Element)nsource; [/code] To me, it seems like a common pat

Re: [Vala] Questions on async functions

2010-02-03 Thread Sam Wilson
> > Q2. > > Any hope of getting the following replaced > > with a better syntax? :-) > > > >Idle.add(async_function.callback); > >yield; > > > > Why not simply: > > > >yield; > > > > ? > > > > Because 'yield' just stops the method until the callback resumes it. It > does nothing

Re: [Vala] Proper Syntax for Array of Nullable Strings

2010-01-20 Thread Sam Wilson
> Date: Wed, 20 Jan 2010 23:23:11 +0100 > From: scumm_fr...@gmx.net > To: vala-list@gnome.org > Subject: Re: [Vala] Proper Syntax for Array of Nullable Strings > > Jiří Zárevúcky wrote: > > tecywiz121 píše v St 20. 01. 2010 v 16:49 -0500: > >> I am just wondering if it is possible to have an ar

Re: [Vala] Proper Syntax for Array of Nullable Strings

2010-01-20 Thread Sam Wilson
> Subject: Re: [Vala] Proper Syntax for Array of Nullable Strings > From: zarevucky.j...@gmail.com > To: tecywiz...@hotmail.com > CC: vala-list@gnome.org > Date: Wed, 20 Jan 2010 23:08:19 +0100 > > tecywiz121 píše v St 20. 01. 2010 v 16:49 -0500: > > I am just wondering if it is possible to have

[Vala] Array Property Length Not Matching What I Expect

2010-01-19 Thread Sam Wilson
Okay, here is try number two at asking my question. If you couldn't tell I am new to the mailing list world. In the code snippet below, I am attempting to read the length of an array through a property. For some reason the returned result is completely random, but when I set a temporary variabl

[Vala] Another Question

2010-01-19 Thread Sam Wilson
Hello once again friendly mailing list! I have another question, probably my own fault this time: why does the following not produce what I expect it to? [code]public int main(){string[] test_array, test2; TestClass tc; ulong len1, len2; test_array = new string[100];

[Vala] Unboxing Value Types

2010-01-19 Thread Sam Wilson
Hello again! random question, how are you supposed to unbox a value type (say float) ? Here is how I am trying to do it, but it won't compile: [code] public void main(string[] args) { float? a = 6; printfloat((float)a); } public void printfloat(float t) { stdout.printf("%f\n", t);

[Vala] New Member / Democamp at CUSEC

2010-01-19 Thread Sam Wilson
Hello! My name is Sam Wilson, though I usually go by tecywiz121 online. First I'd just like to say hi to everyone who works or is interested in vala, and thanks for making a very cool new programming language! Some random background about me: I'm a software engineering student en