Re: [Vala] question



Yes, I've read the tutorial, I'm slowly reading and trying.
In fact my application is already running, but surely not the best code for
vala and many details are not working.

For example, as I express this python code in vala?:

         self.inplay.get_children items = ()

         for item in items:
             if item.tipo == "Player":
                 item.stop ()
                 self.inplay.remove (item)
                 item.destroy ()

This does not work:

         var items = this.inplay.get_children();

         foreach (var item in items) {
             if (item.tipo == "Player") {
                 item.player.stop ();
                 this.inplay.remove (item);
                 item.destroy ();
             }
         }


2014-03-04 14:13 GMT-02:00 Luca Dionisi <luca dionisi gmail com>:

I suggest you not to spend time learning the Makefile syntax.
As a beginner, try to compile the program yourself, is easier.
You pass all the files to the valac command line.
If you do not use namespaces your classes must have unique names.
Did you already read the vala tutorial, at least the first part?
https://wiki.gnome.org/Projects/Vala/Tutorial


On Tue, Mar 4, 2014 at 5:00 PM, Flavio Danesse <fdanesse gmail com> wrote:
Well, but there are several things I do not understand because I can not
find examples.

For example, namespaces not uses because I have not found any example of
use, explanations of the official website I have no clear and it does not
say as implemented in practice.

Regarding compiling with python is not required, so not much about it .
I found an example where a makefile gun and I rely on it, but do not
understand much either, so far I've only written the following:

all: jamedia

jamedia : JAMedia.vala
valac - pkg gtk + -3.0 - pkg gstreamer -1.0 $ < -o $ @

How do I add other files .vala in the makefile?

If I have a directory structure with many files of code, as I do to
compile
it?
And as I do in the code to refer to particular classes of certain files
within that structure where I can have files with the same name and
classes
with the same name?

As I said before I am python programmer.
There are things that are very simple to do in python, there are both
vala,

Some examples :

I have a class called MyClass ( Gtk.Frame ), from which instantiate
objects
and pack it into a box, in python, if I box.get_children (), it returns
the
type MyClass widgets, but widgets vala me back, so which I can not use my
implementation will MyClass.

Sorry for my ignorance, I'm just a few days ago vala programming in, I
really like, but there are still several things I do not understand.

Thank you for your attention and response.


2014-03-04 9:38 GMT-02:00 Luca Dionisi <luca dionisi gmail com>:

I assume you are not using namespaces.
I assume the external files that you talk about are source files of
your application (as in not an already compiled library)
In this case you should need to do... nothing.
Just include all the source files during compilation.

HTH. Go ahead with learning!


On Tue, Mar 4, 2014 at 12:22 PM, Flavio Danesse <fdanesse gmail com>
wrote:
Hello, I'm starting to learn this language and basically I decided to
migrate one of my applications python + gtk + gstreamer and although I
already have a lot of ported code, I have some doubts that I can not
solve.

One is as I import classes that are in external files to python style:

from my_file import my_class
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list





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