Vala and Genie programming

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#166 Post by MU »

I have not used Gtkbuilder yet, as I did not understand exactly, how to use those files in Genie.
It is something though I must look at in future, as libglade has become depreciated, and Gtkbuilder shall be used instead.

Concerning libpcre:
yes, replace them (but backup the old ones first).
Or better try what I suggest next:

I just tried to reproduce your problems in Puppy 4.20.
It works however.

I installed these files:
http://dotpups.de/puppy4/dotpups/Progra ... 0-i486.pet
http://dotpups.de/puppy4/dotpups/Progra ... -2.4.2.pet
http://dotpups.de/puppy4/dotpups/Progra ... -03-27.pet

Then in a console, I typed:
validestart

I clicked on "new projet", chose "Genie , Gtk".
Filled in every field then (that is important - also the license, or the IDE crashes later, if you try to open the options).

If you loose syntax highligting in other programs, try to run them with a startscript like /usr/bin/validestart.
It forces to load the newer Gtk libraries required by the newer gtksourceview.

If you need help with that, let me know.
I can compile vala 0.7.2 tomorrow, today I was away and had no time for programming.
Tomorrow I will be away, too, but hope I can compile it in the evening.
For first steps, 0.7.0 should be fine though.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#167 Post by MU »

and important:
if you use Vala-IDE, other programs might crash afterwards, e.g. seamonkey.
This happens if you try to open the "file open" diialog.
The reason is the file /root/.recently-used.xbel.

Simply delete it then, the Ide seems to write a wrong line in there.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#168 Post by gpnet »

Hi MU,

Sorry , I didn't save the libs before replacing.

Any way I can tray to copy from the .sfs. Well now I remove the currents and try to install the packages you link me.
I would like to get rid of this!.

I thank you if you can compile vala 0.7.2.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#169 Post by MU »

[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#170 Post by gpnet »

Thank you MU

Now I'll try. I'll keep you informed.

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#171 Post by gpnet »

Wow, it works!

I have installed vala 0.7.2 / gtksourceview 2.4.2 and valide and launch from terminal /usr/bin/validestart.

All seems to work. Only one notation; missing lib linselinux.so.1 , what is this? and what is need for ?

Last thing. I was walking in the other thread "Mono / .net related stuff - Monodevelop.sfs" and I found what I was looking for. I appreciate all the work you and others guys are working on.

I , and my colleagues, are c++Builder and c# developers but also we like linux and puppy. My goal was to try to port part of our application to puppy. That's why I am interested in vala.

the problem for me is that I have a good experience in windows but not in linux nor in puppy. I could try to work with monodevelop/mono but I think , like you, it would be better to work in vala.
The work of converting c# widgets to gtk glade is the right clue we need to go one step ahead.

Also I think there is a very interesting tgkaml because is closer to c# mode to define widgets inside a program and also because is more readable than glade.

I stay tuned to see how the thing goes on.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#172 Post by MU »

All seems to work. Only one notation; missing lib linselinux.so.1 , what is this? and what is need for ?
No idea, must check it out tomorrow.

-----------------------------------------------------
I attach Picturebrowser 0.6, including the windows binary.
Like Pictureviewer, it now depends on the PDF-library Poppler, see:
http://www.murga-linux.com/puppy/viewto ... 062#303062

Details:
http://www.murga-linux.com/puppy/viewto ... 550#306550

Unfortunately, main.gs has become somewhat "untidy", as the program as such meanwhile is pretty complex.
So it might not be well suited as example for people who want to learn Genie from new.
I must add more comments, and soon start to write the "example browser" with shorter examples.

Mark
Last edited by MU on Mon 18 May 2009, 00:35, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#173 Post by gpnet »

Thanks MU,

I'll give a try, to understand a little bit better.

Could I also ask you to create a new PET for the new tgkaml-0.2.6 ?.

... the time has come to learn it by myself. Tomorrow I want to try.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#174 Post by MU »

you just download the source, extract it, then open a console in that folder, and type:

./configure --prefix=/usr
make
new2dir make install


After a while you get the question, if a PET shall be created.
Before you confirm, examine the new program-i486 folder.
It has folder usr/bin and usr/lib.
Open a console in them, and type:
strip *

Then continue to build the pet.
(note: NEVER run strip * in Puppys own /usr !!!)

I uploaded a pet of gtkaml-0.2.6 with the binary, and a *.tgz with the full source compiled. It has some subfolders with examples to run with a mouseclick.
http://dotpups.de/puppy4/dotpups/Programming/Vala/
(compiled in Puppy 4.12)

Buena notte,

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#175 Post by MU »

Picturebrowser 0.6 had a bug, I uploaded a fixed archive.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#176 Post by gpnet »

Hi , Mark,

Wow, I tried to create a PET package. It works ! . nice. Though I am requested to enter/confirm a lot of questions, at the end the Pet package is out.

I think this would be a nice exercise for a genie/vala program with a nice form.

Now , all the bricks are well sited and the environment it's coming to take place.
Two more questions: ( if I can and if this is the proper thread )

1. Using seaMonkey do you know if it possible in to save the currents open tabs like I can do in firefox ?. this is very usefull when I have have several tab open and I want to have they open at the next launch.

2. I use tuxcmd as file manager. I noted when I search something in file system, that there is a symlink in /mnt whose name is /Home that result in a endless loop. I dont know why is this necessary but I want to know how to getting around this.

thanks Mark for all your help.

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#177 Post by gpnet »

Hi MU,

Sorry, I am here again to well out of your patience. I was initiating a test vala pgm using gtk.builder with glade , so I downloaded the example ( sample.ui) and tried to compile it in vala, but when I launch the pgm I got this error :

: required gtk+ version 2.16 , current version is 2.14

I tried to find current package 2.14 where it is, but I didn't find it. Suppose that now I download it from ftp.gnome.org and I install it, I would like to know if the new installed version totally replace the older one or I have two packages installed in the system ?.

Same question is for glage 3.6 over the current installed and gnerally for all upgrades.

Thanks Mark.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#178 Post by MU »

sorry for the short answers, but I'll be away again in some minutes.

I'd suggest to try this "Monodevelop" iso:
http://www.murga-linux.com/puppy/viewtopic.php?t=40567

It is based on ultrapup/newyearspup, that uses a newer Gtk library.
Compiling Gtk yourself might work, but you certainly also would need a newer glib, and maybe others, like pango or cairo.

The upgrade would replace the existing Gtk libs in /usr/lib/.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#179 Post by gpnet »

Hi MU,

You right. In fact I tried to download and compile gt+2.16 source and when I launched the ./configure command I have got the warning abou Pango and cairo libs also.

so I opened a new thread in "users" about the update of gtk.

I would prefer to set the environment in the proper way because my intention is to start programming in puppy. I currently work with sharpdevelop in win XP3 and I know monodevelop. I don't know linux and puppy and this is what i would like to learn.

I know that the road may contain some hole , but this is the way I learn. I thought you help me to smooth the way, if you can.

Do you agree ?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#180 Post by MU »

well the problem is:
Puppy has the old Gtk.
So if you upgrade to compile, and then want to spread the program, other Puppys cannot use it, unless they also upgrade Gtk.

Yo would have the same problem with the monodevelop iso.
I develop in newyearspu, but the final pets I create (compile) in Puppy 4.12.

In some cases this does not work.
E.g. in the pictureviewer, the picture is centered, when you zoom in.
To calculate the position, I used the size values you can request from a "GtkAdjustment".
In Puppy 4 then I got an error, that this is not supported by the older Gtk.
So I had to use other comands to get it working.

But if you need Gtk 2.16, simply also compile the dependencies, like Glib, Pango and Cairo.
With some luck, this is sufficient, if I remember well, nothing more is needed.

You can backup your savefile first, in case you mess up your system, or use a second one.
(I assume a frugal installation).
Boot from CD with the option:
puppy pfix=ram
That starts without the first savefile, so at shutdown you are offered to create a second one (you MUST use a different name there).
Then on next start, you get a small menu, to select one of the savefiles.
So you can use one for tests, and one for normal use.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#181 Post by gpnet »

Thanks Mark.

Unfortunately I have a full HD install. Ok , with a little patience and luck I try to compile packages.

Let me know one thing. When I launch ./configure the gtk+-2.16.1 i got this warning :

Requested 'glib-2.0 >= 2.19.7 but version of Glib is 2.14.2
Requested 'Pango >= 1.20 but version of 'Pango is 1.18.3
Requested 'cairo >= 1.6 but version of Glib is 1.5.12

I checked in my /usr/lib for libglib version and I found 2 version :

1. libglib-2.0.so.0.1400.2 2009/05/11 16.10.51
2. libglib-2.0.so.0.2000.1 2009/05/11 17.57.40

I remembered I have already installed a new version of glib and I thought the system replaced the newer over the older.

How can set things right so that the system see only the x.2000.1 lib
before to proceed ?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#182 Post by MU »

I think you installed a PET.
I think, it might just include the "runtime" (shared object) files, like /usr/lib/*.so.
But to compile, you also need the *.la or *.a files, and an entry for pkgconfig in /usr/lib/pkgconfig/. And the headers in /usr/include/.

This means, you also must install the DEV.pet of that Glib if available, or compile it yourself, to get those files.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#183 Post by gpnet »

The road now seems to climb a little. tomorrow I will think with a little calm.

Thanks Mark.

Gute nacht.

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#184 Post by gposil »

Thought i'd see what all the fuss was about with vala/genie so installed all Mark's files and this is what I get when I try to compile HelloWorld.gs
In file included from /usr/include/gtk-2.0/gdk/gdkcairo.h:23, from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gdk/gdkcolor.h:30:19: error: cairo.h: No such file or directory In file included from /usr/include/gtk-2.0/gdk/gdkcolor.h:31, from /usr/include/gtk-2.0/gdk/gdkcairo.h:23, from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gdk/gdktypes.h:51:23: error: gdkconfig.h: No such file or directory In file included from /usr/include/gtk-2.0/gdk/gdkcairo.h:25, from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/pango-1.0/pango/pangocairo.h:60: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:71: error: expected ')' before 'fonttype' /usr/include/pango-1.0/pango/pangocairo.h:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pango_cairo_font_map_get_font_type' /usr/include/pango-1.0/pango/pangocairo.h:85: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:89: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:93: error: expected ';', ',' or ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:94: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:101: error: expected declaration specifiers or '...' before 'PangoCairoShapeRendererFunc' /usr/include/pango-1.0/pango/pangocairo.h:104: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pango_cairo_context_get_shape_renderer' /usr/include/pango-1.0/pango/pangocairo.h:109: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:110: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:116: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:119: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:121: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:124: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:133: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:136: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:138: error: expected ')' before '*' token /usr/include/pango-1.0/pango/pangocairo.h:141: error: expected ')' before '*' token In file included from /usr/include/gtk-2.0/gdk/gdk.h:30, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gdk/gdkcairo.h:29: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/include/gtk-2.0/gdk/gdkcairo.h:31: error: expected ')' before '*' token /usr/include/gtk-2.0/gdk/gdkcairo.h:33: error: expected ')' before '*' token /usr/include/gtk-2.0/gdk/gdkcairo.h:37: error: expected ')' before '*' token /usr/include/gtk-2.0/gdk/gdkcairo.h:42: error: expected ')' before '*' token /usr/include/gtk-2.0/gdk/gdkcairo.h:44: error: expected ')' before '*' token In file included from /usr/include/gtk-2.0/gdk/gdk.h:35, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gdk/gdkdrawable.h:196: error: expected specifier-qualifier-list before 'cairo_surface_t' In file included from /usr/include/gtk-2.0/gdk/gdk.h:50, from /usr/include/gtk-2.0/gtk/gtk.h:31, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gdk/gdkscreen.h:51: error: expected specifier-qualifier-list before 'cairo_font_options_t' /usr/include/gtk-2.0/gdk/gdkscreen.h:107: error: expected ';', ',' or ')' before '*' token /usr/include/gtk-2.0/gdk/gdkscreen.h:108: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token In file included from /usr/include/gtk-2.0/gtk/gtkprintoperation.h:31, from /usr/include/gtk-2.0/gtk/gtk.h:137, from /root/Test/main.vala.c:4: /usr/include/gtk-2.0/gtk/gtkprintcontext.h:41: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token /usr/include/gtk-2.0/gtk/gtkprintcontext.h:56: error: expected declaration specifiers or '...' before 'cairo_t' error: cc exited with status 256 Process return 256 execution time: 3.28318 s
Any clues
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

gpnet
Posts: 56
Joined: Sat 09 May 2009, 15:49
Location: Ivrea ,Italy

#185 Post by gpnet »

Hi MU,

I thought about the situation.
let's go back one step. I am very motivated to work with puppy as a developer. ( that is my job).

I don't think I would like to learn script language. I must be as productive as possible and so this brings me to a couple of languages ( c# or vala/genie).

Probably I am early with the new releases of puppy in order to a new developer environment rightly set up.

So Now. I have 2 choises:

1. Stop and wait the next release of puppy where I should find the new developer environment.

2. Ask Your help ( I mean the puppy team ) to align the current dev-env to the required evn to work with c# or vala/genie

In the second case I have to consider for update/upgrade procedure. I mean what would be the procedure to update/upgrade from current release to the next, considering that I have a full HD install.

If is there a procedure that automatically update all the system from the current to the next release, all is Ok.
If Puppy consider the new release a stand alone release and I have to move by myself all my work and tweekings, than I have to wait.

Any suggestion is welcome.

Post Reply