[Vala] viewport ADD

2013-01-14 Thread Luis L. Rodríguez Oro
How can I add object to the viewport?? //valac --pkg gtk+-3.0 viewport.vala public class Application : Gtk.Window { private Gtk.Viewport viewport; private Gtk.ScrolledWindow scrolled; public Application () { // Prepare Gtk.Window: this.title = "My Gtk.Viewport";

[Vala] run the metho1 from the method2 of class2

2012-09-11 Thread 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; private Class2 class2; public main_window

[Vala] Soup message.response_body.data is null

2012-08-16 Thread Luis L. Rodríguez Oro
Hello devs, Please help me. I have this code to get a json text from a server, when I put the url in the web browser I get the Json OK. But in this code I get NULL at response_body.data and length = 0. Please what I do wrong // valac --pkg libsoup-2.4 using Soup; void main () { var

Re: [Vala] Single instance...

2012-08-08 Thread Luis L. Rodríguez Oro
El 03/08/12 14:11, "Luis L. Rodríguez Oro" escribió: When I try to run this code show error "Violación de segmento". Any ideas to fix it? I want to run a single instance of my app. //valac valac --pkg unique-1.0 using Unique; int main(string[] args){ Unique.App

[Vala] Single instance...

2012-08-03 Thread Luis L. Rodríguez Oro
When I try to run this code show error "Violación de segmento". Any ideas to fix it? I want to run a single instance of my app. //valac valac --pkg unique-1.0 using Unique; int main(string[] args){ Unique.App app = new Unique.App("org.centinela.unique", null); //Error here! if(app.is

[Vala] regex to get some multiline text

2012-05-09 Thread Luis L. Rodríguez Oro
I try write a regular expresion to get some text, something like this: int main () { string the_string = """ start text line 1 start text line 2 %tag:keytag% the content betwen tag line1 %endtag% the end line 1 the end line 2

[Vala] jSON parser

2012-03-14 Thread Luis L. Rodríguez Oro
in this examples Im parse a JSON: {"data":50} // JSON var parser = new Json.Parser (); parser.load_from_file ("cuota.json"); var root_object = parser.get_root ().get_object (); stdout.printf ("data: %d\n", root_object.get_int_member ("data")); // work perfect! {"data":50.65} // jSON stdou

[Vala] Launcher favorites values

2011-11-01 Thread Luis L. Rodríguez Oro
How get gsetting get com.canonical.Unity.Launcher favorites values? I try this: using GLib; void main () { var settings = new GLib.Settings ("com.canonical.Unity.Launcher"); var greeting = settings.get_string ("favorites"); print ("%s\n", greeting); } but I cant get it. Fin a la injust

[Vala] RC4 encryption algorithm

2011-10-27 Thread Luis L. Rodríguez Oro
hello, I have some problem with RC4 encryption algorithm. I don't know in what point the algorithm be come asymmetric. Please, help me. string rc4_encrypt(string key, string text) { int S[255]; int i; int len = key.length; int j = 0; int temp; for (i = 0; i < 255; i++)

Re: [Vala] encrypt decrypt

2011-10-26 Thread Luis L. Rodríguez Oro
El 22/10/11 12:40, "Luis L. Rodríguez Oro" escribió: El 22/10/11 11:05, pancake escribió: What do you want from us? Implement a criptografic algorithm for you? There are several criptographic algorithms to do that. Check wikipedia. If you do not specify the algo we cant help, as l

Re: [Vala] ascii

2011-10-25 Thread Luis L. Rodríguez Oro
El 25/10/11 08:52, Rodrigo Esteban Cares Guarda escribió: Hi, You can try: int ascii_value = int.parse("%d".printf('X')); Replacing X char by your character. Good luck. El mar, 25-10-2011 a las 08:10 -0400, "Luis L. Rodríguez Oro" escribió: How can i g

Re: [Vala] ascii

2011-10-25 Thread Luis L. Rodríguez Oro
El 25/10/11 11:24, Xavier Bestel escribió: On Tue, 2011-10-25 at 11:19 -0400, "Luis L. Rodríguez Oro" wrote: El 25/10/11 08:52, Rodrigo Esteban Cares Guarda escribió: Hi, You can try: int ascii_value = int.parse("%d".printf('X')); Replacing X char by your char

Re: [Vala] ascii

2011-10-25 Thread Luis L. Rodríguez Oro
El 25/10/11 08:52, Rodrigo Esteban Cares Guarda escribió: Hi, You can try: int ascii_value = int.parse("%d".printf('X')); Replacing X char by your character. Good luck. El mar, 25-10-2011 a las 08:10 -0400, "Luis L. Rodríguez Oro" escribió: How can i g

[Vala] ascii

2011-10-25 Thread Luis L. Rodríguez Oro
How can i get ascii code from a character? Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU! http://www.antiterroristas.cu http://justiciaparaloscinco.wordpress.com ___ vala-list

[Vala] ascii code

2011-10-24 Thread Luis L. Rodríguez Oro
how get ascii code from unichar var? unichar c; int ascii; ascii = print("ascii =%d", ascii); Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU! http://www.antiterroristas.cu http://justiciaparaloscinco.wordpress.com __

Re: [Vala] ConfigParser

2011-10-24 Thread Luis L. Rodríguez Oro
El 22/10/11 10:44, "Luis L. Rodríguez Oro" escribió: hello. I need save the config of my app. Something like configParser of python. exists any similar for Vala? Answer my self: class Ini { private string file; KeyFile kf = new KeyFile(); public Ini(s

Re: [Vala] encrypt decrypt

2011-10-22 Thread Luis L. Rodríguez Oro
ok, I download libgcrypt. I ./configure, make, make install. And now how i can used in my app. Please be patient with me. Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU! http://www.antiterroristas.cu http://justiciaparal

Re: [Vala] encrypt decrypt

2011-10-22 Thread Luis L. Rodríguez Oro
scratch or use any of the available opensource libraries out there. On 22/10/2011, at 16:52, "Luis L. Rodríguez Oro" wrote: I need encrypt and decrypt come text: string decrypt(string text, string password){ // code return decrypted; } string encrypt(string text, string password

[Vala] encrypt decrypt

2011-10-22 Thread Luis L. Rodríguez Oro
I need encrypt and decrypt come text: string decrypt(string text, string password){ // code return decrypted; } string encrypt(string text, string password){ // code return encrypted; } void main(){ string text = "hello word"; string pass = "p4ssw0rd"; string enc = encrypt(tex

[Vala] ConfigParser

2011-10-22 Thread Luis L. Rodríguez Oro
hello. I need save the config of my app. Something like configParser of python. exists any similar for Vala? Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU! http://www.antiterroristas.cu http://justiciaparaloscinco.wor

Re: [Vala] repeat every n seconds

2011-10-21 Thread Luis L. Rodríguez Oro
This work great! void main () { Timeout.add(seconds * 1000, myfunction); var m = new MainLoop(); m.run(); } thanks every body! Fin a la injusticia, LIBERTAD AHORA A NUESTROS CINCO COMPATRIOTAS QUE SE ENCUENTRAN INJUSTAMENTE EN PRISIONES DE LOS EEUU! http://www.antiterroristas.cu

[Vala] repeat every n seconds

2011-10-20 Thread Luis L. Rodríguez Oro
Hello friends, I need run a function indefinitely every N secods, something like this. using GLib; int seconds = 5; bool myfunction(){ stdout.printf ("ok\n"); return true; } void main () { //how run my function every 5 seconds myfunction(); // this run only one time } I'am n