Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 21 Dec 2014, 16:23
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Vala and Genie programming
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 11 of 35 Posts_count   Goto page: Previous 1, 2, 3, ..., 9, 10, 11, 12, 13, ..., 33, 34, 35 Next
Author Message
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Tue 05 May 2009, 11:11    Post_subject:  

I attach picturebrowser v0.4.

Massive internal changes.

The whole treeclass was cleaned up, and is easier to use.
I think it now has reached the "final" structure, so the method names will not change in future.
I just might add some more, or enhance some. what might require more parameters.

Old code:
Code:
    treeclass1 = new treeclass()
    treeclass1.mode = "filebrowser"
    mytree1 = treeclass1.treeview()
    treeclass1.column.set_title("Folders")
    get_scrolledwindow("scrolledwindow1" ).add (mytree1)


    var iter = treeclass2.get_first_iter(mytree2)
        if treeclass2.store.iter_is_valid(iter)
            treeclass2.select_iter(treeclass2, iter)
            tree2_row_click()

New code:
Code:
    tree1 = new treeclass()
    tree1.mode = "filebrowser"
    tree1.init()
    tree1.column.set_title("Folders")
    var sw1 = (ScrolledWindow)get_widget("scrolledwindow1")
    sw1.add(tree1.tree)

    tree2.select_first_item()
    tree2_row_click()


Please note, that also the libglade.gs changed.

old:
Code:
    get_scrolledwindow("scrolledwindow1" ).add (mytree1)

This used a method, that had to be defined "by hand", like this:
Code:
//-- HELPER method: this method returns a SCROLLEDWINDOW ! --

def get_scrolledwindow(name : string) : ScrolledWindow
    b : Gtk.ScrolledWindow*
    var w = xml.get_widget(name)
    b = (ScrolledWindow) w
    return b

This is no longer needed!
You only need these 2 lines:
Code:
    var sw1 = (ScrolledWindow) get_widget("scrolledwindow1")
    sw1.add(tree1.tree)


I think this is one of the enhancements in Vala 0.7.1, if I remember well, it did not work in 0.5.7, so I had written those helper methods.

The Windows binary is included again.

The program no longer uses "Threads" to scale a picture, but a method based on Gdk.Pixbuf.
This works faster, needs less resources (14% cpu-usage instead of 42%), and works in Linux and Windows.

And bookmarks now also work with special characters in the filenames.

A PET for Puppy 4.12 follows later.

Mark

_________________
my recommended links

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Tue 05 May 2009, 16:16    Post_subject:  

version 0.5, see:
http://www.murga-linux.com/puppy/viewtopic.php?p=302432#302432

Mark
Picturebrowser-0.5.zip
Description 
zip

 Download 
Filename  Picturebrowser-0.5.zip 
Filesize  620.25 KB 
Downloaded  535 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 06 May 2009, 18:06    Post_subject:  

I seperated the code to display the pictures in a own class now.
So it can easily embedded in own programs.
The class even manages to download pictures, that are dropped on the viewer (it uses wget).

I attach the source of a seperate small example application, that is described here:
http://www.murga-linux.com/puppy/viewtopic.php?p=302769#302769

As no tree is included, this example is extremely short Smile


The source for the picturebrowser is not adapted yet.
Mark
Class-Pictureview-0.1b.zip
Description 
zip

 Download 
Filename  Class-Pictureview-0.1b.zip 
Filesize  44.15 KB 
Downloaded  500 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 07 May 2009, 03:45    Post_subject:  

there was a bug in the load_picture() method in the pictureview class.
There 3 methods were called with a leading "picview.", so it did not work, if your instance of the class had a different name.

Uploaded 0.1b.

Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 07 May 2009, 15:08    Post_subject:  

I updated the pictureviewer class, it can display PDF files now.

On Windows, you also need:
http://dotpups.de/puppy4/dotpups/Programming/Vala/Vala-for-Windows/Class-Pictureview-0.2-Windowslibs.zip

http://dotpups.de/puppy4/dotpups/Programming/Vala/Vala-for-Windows/readme-Class-Pictureview-0.2-Windowslibs.txt

Mark
Class-Pictureview-0.2.zip
Description 
zip

 Download 
Filename  Class-Pictureview-0.2.zip 
Filesize  48.82 KB 
Downloaded  460 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 08 May 2009, 11:39    Post_subject:  

new update, see:
http://www.murga-linux.com/puppy/viewtopic.php?p=303348#303348

Windows binary included again, see previous messages for dependencies on Windows.

Mark
Class-Pictureview-0.3.zip
Description 
zip

 Download 
Filename  Class-Pictureview-0.3.zip 
Filesize  54.19 KB 
Downloaded  492 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 14 May 2009, 21:57    Post_subject:  

here is a small interface for Mplayer.
The GIT version no longer supports an own grafical interface as far as I see.

So I hacked together this simple "playbar" , it allows to pause or switch fullscreen.
The cursor keys work too, to jump forward/backward.

In jwm, the playbar is covered in fullscreen mode, hit "f" to turn of fullscreen again.


The playbar has no fileselector, so you must pass a movie as commandline argument, or add the "genie-mplayer" script with full path as run-action to rox-filer (set the correct path in that script, too).

In the current state, it is not really recommended for average users, I just post it as small coding example.
Compiled in Puppy 412.

Mark
GenieMplayer-0.2.tar.gz
Description 
gz

 Download 
Filename  GenieMplayer-0.2.tar.gz 
Filesize  17.09 KB 
Downloaded  497 Time(s) 
GenieMplayer.jpg
 Description   
 Filesize   32.96 KB
 Viewed   1298 Time(s)

GenieMplayer.jpg


_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 15 May 2009, 04:33    Post_subject:  

the Genie mplayer did not compile in Puppy 4.12, I added some changes, so now it works.
Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
caleb72

Joined: 15 May 2009
Posts: 57

PostPosted: Fri 15 May 2009, 08:49    Post_subject:  

Can anyone play here?

I like developing in Python (Windows refugee) and am wondering if I should have a go at Genie.

I'm very fond of the Python syntax and style which makes me think Genie is the more logical choice for me rather than Vala for example.

I can't really find a huge amount of info - Barry's page with the examples is about all. Just wondering how to go about diving into Genie.

Regards
Caleb
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Fri 15 May 2009, 11:17    Post_subject:  

Quote:
am wondering if I should have a go at Genie


Yes. This thread and Barrys page is about all there is in Genie (it is very new)
Valide and Genie are part of the devx for the latest Woof alphas.

Marks examples (go through this thread) and my paltry efforts are a good place to begin.
Genie is faster (being compiled) than Python and works on both Windows and Linux, creating standalone efficient code.

Mark is very supportive and Barry will be providing more work in the future Wink

Be a Pioneer Puppy

_________________
Puppy WIKI

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 15 May 2009, 11:30    Post_subject:  

there are not many Genie examples.

But once you wrote some small programs, using our examples as template, you will find a meanwhile quite huge collection of other examples: those from Vala.

A genie program has a simpler syntax.
So it is pretty easy, to "translate" vala code to genie.

This is especially valid for Gtk based examples.
Both languages use external libraries, and their call are almost identical.

Vala
Code:
if ( a == 10){
    window.set_title("test");
}


Genie:
Code:
if a is 10
    window.set_title("test")


So translating parts of code basically means to remove some "{ }" , some ";" and rename some keywords ("is" instead of "==").

I currently collect small examples, and will upload them in 3 weeks or so, after I cleaned them up.
It will be a collection of those posted in this thread, and maybe some simple others.
They can be browsed using a treeview, and you then can run them, or open them in the Vala-Ide.
But first I need to clean them, as especially my first Glade examples were too complicated, they can be simplified like the last ones.

Mark

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
caleb72

Joined: 15 May 2009
Posts: 57

PostPosted: Fri 15 May 2009, 19:09    Post_subject:  

Good to know.
I will try to jump in when I can.

I'm currently swamped with Perl coding commitments for work - but I'll keep an eye on this for personal programming projects.

Great to see it can compile to Windows executable as well if the need arrives. With a windows executable will there be any dependencies or are they all built into the binary?

Regards
Caleb
Back to top
View user's profile Send_private_message 
gpnet

Joined: 09 May 2009
Posts: 51
Location: Ivrea ,Italy

PostPosted: Sat 16 May 2009, 10:29    Post_subject:  

Hi to all , Guys

I need help.
I have puppy 4.20 and devx_420.sfs installed.
I usually program in win c# and I would like to try vala in puppy. So I have download these packages from a deb repository:

valac_0.7.2-1_i386.deb
libvala0_0.7.2-1_i386.deb
vala-utils_0.3.4-1_i386.deb
libcairo2_1.4.14-1_i386.deb
.. because I wanted to try the last version with last fixed bugs.
.. converted to pet and installed

and gtksourceview-2.0.2-i486.pet from this thread

and valide-0.4-1-i686-svn-2009-03-27.pet from this site : http://dotpups.de/puppy4/dotpups/Programming/Vala/

Next step i compile by hand the hello.vala pgm example, and all gone well

so i tried to create a new project in valaide and I have got these errors:

1. when I try to create a new project :
valide_project_manager_copy_template: assertion `path != NULL' failed

2. so i create a project by hand copying from glade1.vide in this thread and than open the project and tried to compile. but I have got this error:

PCRE library is compiled without UTF8 properties support.

Coul any one help me to understand what's wrog !

thanks
Back to top
View user's profile Send_private_message 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Sat 16 May 2009, 18:00    Post_subject:  

gpnet,
Please use this gtksourceview, the other one works erratic:
http://dotpups.de/puppy4/dotpups/Programming/Vala/gtksourceview-2.4.2.pet

I also attach the pcre-libraries I use in newyearspup.
Maybe those work for you.

Caleb,
no, the libs are not built into the binary.

There are 2 ways to deliver them:
1.) the user installs vala, a 10 MB download.
2.) you add the required libs in the same folder, where your binary is located.

I made a 5 MB (12 MB extracted) example package including required Wiindows libs:
http://www.murga-linux.com/puppy/viewtopic.php?t=40193
It is a pet, so easy to install, then it can be run with Wine.

Mark
libpcre.tar.gz
Description 
gz

 Download 
Filename  libpcre.tar.gz 
Filesize  161.09 KB 
Downloaded  489 Time(s) 

_________________
my recommended links
Back to top
View user's profile Send_private_message Visit_website 
gpnet

Joined: 09 May 2009
Posts: 51
Location: Ivrea ,Italy

PostPosted: Sat 16 May 2009, 18:36    Post_subject:  

Hi Mu,

Thanks for replay,

No, I can't use the gtksourceview 2.4.2 with valaide because if I do that (i tried ) I lost syntax Highlight ( almost in vala ). So I had to come back to previous version.

Thank you for the pcre libraries , I presume I have to replace the older one?

And what about the creation of a new project :assertion `path != NULL' failed
have you any suggestion?.

Also I notice that to work with vala / glade would be necessary the 3.6.x version because with this version you can save the xml UI in proper way for Gtk.Builder("xxxxx");
Have you any news about a new release or could I install it from deb packages ?.

Tanks a lot.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 11 of 35 Posts_count   Goto page: Previous 1, 2, 3, ..., 9, 10, 11, 12, 13, ..., 33, 34, 35 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1100s ][ Queries: 13 (0.0100s) ][ GZIP on ]