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
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#406 Post by BarryK »

technosaurus,
Hey, my PET is 40KB! :)

I didn't use the scripts, did it the other way:

# ./waf configure
# ./waf build

...worked fine.
[url]https://bkhome.org/news/[/url]

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#407 Post by ttuuxxx »

Wow just tried the latest nico edit and boy its came a long way.
One thing I would like to see in it is tabs, and when drag a new document to the gui it opens the file in a new tab, eg drag 5 files and have 5 tabs.
after that it could be a geany replacement and not just a leafpad replacement, very close, nice size also :) right now I'm using teagtk the pet is around 140kb and has highlight, line numbers, and drag and drop for tabs. Really thats all I use, I don't need fancy compiling in a editor etc. Geany just getting too bloated.
Oh I see you can export as pdf, hmmm maybe consider images? If you could add images and move them around, It would make a perfect pdf ebook creator. Just some ideas :)

Anyways keep up the excellent work:) very impressive.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#408 Post by BarryK »

Ttuuxxx,
Regarding tabs, I was thinking that too, but then I started playing with the History menu, and that works surprisingly well.

The problem with tabs is I often have several documents open, so have to scroll the tabs, which makes the whole thing somewhat inefficient.

However with the History menu I can flip between documents. However, what spoils that is it doesn't remember the last position. If it did, that would make it very easy to work with a large number of documents.

So, Nicolas, if you read this, my number one request is for the History menu to remember the last position of the window and the cursor position of each previously-opened file!
[url]https://bkhome.org/news/[/url]

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#409 Post by ttuuxxx »

Hi Barry I don't know if you ever tried Teagtk, but it does have a nice menu under file, Like recent documents, bookmarks, sessions, templates, etc and like I mentioned its really small compared to Geany about 1/4 the size. and once you setup the basic configures like I did in my last package its pretty good.

The sources 468kb
http://sourceforge.net/projects/tea-edi ... 2/download

The last package I made up, its good if you want to custom configs in root/choices
http://www.murga-linux.com/puppy/viewto ... h&id=21761

Playing around with the history is a good alternative way of getting around the tab issue, but for a person like myself I think the most tabs I ever need open at once is about 4, Firefox is different sometimes I have like 50 tabs open at once, lol
I would be happy to replace Geany with nicoedit if it had tabs.

ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

ITAmember
Posts: 167
Joined: Sun 13 Sep 2009, 18:50
Location: The middle of a cornfield

#410 Post by ITAmember »

I would like to use id3lib (http://id3lib.sourceforge.net/) in a vala program I'm planing to make. It's a c++ library that can be called from plain old C so it should work without much trouble. The problem is, I have no idea how to make the vapi file. Everything I found via google (which wasn't much) was for glib libraries and used glib only autogeneration. Any hints?

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#411 Post by BarryK »

ITAmember wrote:I would like to use id3lib (http://id3lib.sourceforge.net/) in a vala program I'm planing to make. It's a c++ library that can be called from plain old C so it should work without much trouble. The problem is, I have no idea how to make the vapi file. Everything I found via google (which wasn't much) was for glib libraries and used glib only autogeneration. Any hints?
I seem to recall there was some discussion on the Vala mail-list recently, someone asked that same question. Find the archive of the Vala mail-list ...I don't know the url offhand.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#412 Post by BarryK »

Ah, yes, there is another thing that prevents me from making NicoEdit 2.1 the main text editor in 4.3 -- no line-wrapping!

So, I have to leave Geany as the main text editor. NicoEdit 2.1 will be the secondary editor (Leafpad replacement) in 4.3final.

Line-wrapping is essential for a useful text editor.
[url]https://bkhome.org/news/[/url]

nikobordx
Posts: 84
Joined: Sat 23 May 2009, 09:08
Location: Bordeaux, France

#413 Post by nikobordx »

For NicoEdit, see newer message !
Last edited by nikobordx on Tue 15 Sep 2009, 16:22, edited 1 time in total.

nikobordx
Posts: 84
Joined: Sat 23 May 2009, 09:08
Location: Bordeaux, France

#414 Post by nikobordx »

Hi again,

I make a new version of NicoEdit.

This version correct a bug found on 2.3 when you use the fullscreen.

Download it here: http://www.murga-linux.com/puppy/viewto ... h&id=21799

See you,
Nicolas.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#415 Post by ttuuxxx »

does anyone have it compiled ? I don't have python in 2.20, but the rest of the vala deps are install.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#416 Post by 01micko »

ttuuxxx wrote:does anyone have it compiled ? I don't have python in 2.20, but the rest of the vala deps are install.
ttuuxxx
Yep! Just compiled it and it seems ok, word wrap and fullscreen working :) . Thankyou Nicolas!

One, point, I followed the bk_compile routine and the .pet package created has a bug. The structure is correct of course but the parent dir needs to be "nicoedit-x.x" and that will become the name of the .pet.

Cheers
Attachments
nicoedit-latest.pet
(43.68 KiB) Downloaded 518 times
Puppy Linux Blog - contact me for access

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#417 Post by 01micko »

Please note, the .pet I packaged above is straight from nicolas' compile so may not work on some systems. :wink:
Puppy Linux Blog - contact me for access

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#418 Post by ttuuxxx »

01micko wrote:Please note, the .pet I packaged above is straight from nicolas' compile so may not work on some systems. :wink:
Worked fine for me Mick :) and the fullscreen bug is fixed :)
thanks for that :)
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#419 Post by disciple »

Hi guys, I haven't really looked at Vala yet, but I'm wondering - does anyone have any idea how hard it would be to convert a simple-ish gtk program from c to vala? And how much easier do you think it would be to learn vala than C? Is Vala:
0. No easier than C
1. A little easier than C
2. Quite a bit easier than C
3. A lot easier than C
4. So much easier than C that there's no comparison.

Any thoughts?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#420 Post by disciple »

I see Vala 0.7.6 is released too.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

nikobordx
Posts: 84
Joined: Sat 23 May 2009, 09:08
Location: Bordeaux, France

#421 Post by nikobordx »


caleb72
Posts: 57
Joined: Fri 15 May 2009, 12:44

#422 Post by caleb72 »

This topic hasn't really moved much for a while.

I'm trying again to find time to teach myself Genie and I've got some ideas in mind for some utilities but as we know a huge amount of documentation isn't on hand although there are some good examples in this thread.

What I thought I might do to start teaching myself Gtk programming in Genie is to translate the current Vala Gtk+ Examples into Genie syntax.

I thought it might be useful to have a direct document that could help me see the same examples in Genie syntax that newcomers to Vala have been enjoying previously.

Ideally it would be nice to flesh it out into a full tutorial, but I doubt I would find the time. In any case I really learn by example alot of the time and can't guarantee that I would explain the underlying theories of what's happening with great accuracy as I really know nothing about Gtk in general and am relying on just being able to understand how to use it much like people learning a foreign language through emersion.

Anyway - to my question. Would such an exercise be worthwhile to publish somewhere for other Puppyites?

At the least it's a personal exercise to get me across Gtk programming in Genie - but it could potentially be added somewhere for common reference if it's going to be useful.

Regards
Caleb

nikobordx
Posts: 84
Joined: Sat 23 May 2009, 09:08
Location: Bordeaux, France

#423 Post by nikobordx »

Hi Caleb,

I've created some gtk examples in http://code.valaide.org/

I'm also working on a code generator for genie, and i will make a website with many sample.

Nicolas.

caleb72
Posts: 57
Joined: Fri 15 May 2009, 12:44

#424 Post by caleb72 »

Oooh - thanks for that. I didn't realise there were so many samples available. I've bookmarked it for future reference.

Actually - that makes me more determined to do what I was doing so that I can compare the code that I think looks right with how other people are doing the same thing. Thanks for that.

Regards
Caleb

caleb72
Posts: 57
Joined: Fri 15 May 2009, 12:44

#425 Post by caleb72 »

I've been managing to convert the Vala GTK+ examples I've seen quite easily into Genie - even managed to convert a GtkBuilder example.

Although I have to say, it's a bit weird implementing callback methods via GtkBuilder (in Vala anyway). I haven't tried these peculiarities in Genie. Things like this:
If you declare the callback methods inside a class and/or namespace you have to prefix the callback method in Glade with the namespace/class name in lower case letters and with underscores. For example, Foo.MyBar.on_button_clicked would be foo_my_bar_on_button_clicked in Glade
And this:
If you want the callback methods to be instance methods instead of static methods you have to annotate them with the [CCode(instance_pos=-1)] attribute and pass the instance to connect_signals(...) instead of null
Bizarre.

My instinct in coding these signals/callback methods is to have the GUI XML file as per normal and then I would have an Application class which defines all the callback methods, initiates the gui interface and interacts with the other classes that define the application model as a whole. If the advice above applies to Genie that would mean either I have to create slightly weird signals in that they won't look exactly the same as the callback methods they trigger, or I would need to include this weird CCode thingy in my code which looks incomprehensible to me.

I'm guessing I could also define the callback methods outside of the Application class I create, but that seems a bit weird to me.

Just wondering if there are other people out there using GtkBuilder either in Vala or Genie that could put some perspective on this for me. It may be that I'm just not getting it.

Regards
Caleb

Post Reply