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
PupMike
Posts: 18
Joined: Thu 23 Apr 2009, 01:39

#301 Post by PupMike »

gposil wrote:The verbose printout did it...my versions of pango and pangocairo are much later than puppy std so I rolled them back to 2.18 and problem solved....now compiles same as your test...
Glad to hear you got it sorted out. I have the latest Pango 1.24 installed here and it works just fine btw.

Mike

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

#302 Post by nikobordx »

Hi all,

New version without warning !

Nicolas.
Attachments
texteditor.gs.tar.gz
(4.34 KiB) Downloaded 391 times

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

#303 Post by gpnet »

Hi MU

Did you have time to give a try to the example I posted ?

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

#304 Post by MU »

gpnet wrote:Hi MU

Did you have time to give a try to the example I posted ?
Yes.
I do not have the files/folders it needs, like /root/.packages/unleashed.

So everything is empty.
But the program compiles and runs.
I installed ValaIDE 0.4svn as mentioned in a former message, as 0.5 freezes my upup.

Mark
Attachments
upup.jpg
(107.33 KiB) Downloaded 337 times
[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

#305 Post by gpnet »

this is the code in AppRun from pizzasgood.

Code: Select all

#ensure there's a deadpackages.txt file, and that it has stuff in it
DEADLIST="$HOME/.packages/deadpackages.txt"
if [ ! -e "$DEADLIST" ] || [ "$(cat "$DEADLIST")" = "" ]; then
	cp "$HOME/.packages/packages.txt" "$DEADLIST"
fi
So I don't understand clearly the logic behind that , but as you see it copy the content from packages.txt to deadpackages.txt and than visualize this content.
All this file must stay in $HOME/.packages . isn't it ?

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

#306 Post by MU »

yes ok, I have packages.txt and deadpackages.txt in /root/.packages/.
I also adjusted the path-settings in the code (default was F:/...).

What I don't have, is /root/.packages/unleashed/
So I created that folder.
But as it is empty, I get:
**(PetBeGone:28009): CRITICAL **: main_form_ReadVersion: assertion 'txline != null' failed
The program then refuses to run.
If I delete that empty folder, the program starts, but empty as on the screenshot.

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:

#307 Post by MU »

ah I see... the format of the files has changed in upup.
Puppy 4 uses spaces as delimiter, upup uses "|".

So it cannot run without changes in upup, if it was written for older Puppys.
The files contain additional informations, too.

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

#308 Post by gpnet »

You right,

I made the work base on my puppy 4.2. as the version of PetBeGone.pet.

May I change something in reading the delimiters fields if you post me a new packages.txt example.

I surely was thinking this experiment for upup!

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

#309 Post by MU »

/root/.packages/ from upup 476:
http://dotpups.de/tests/packages-06.04. ... .53.tar.gz

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

#310 Post by gpnet »

wow , It is All changed !

Is there any schema of the new format ? and the logic they are on/off in the system ?

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

#311 Post by BarryK »

gpnet wrote:wow , It is All changed !

Is there any schema of the new format ? and the logic they are on/off in the system ?
The new Woof packaging:

http://puppylinux.com/woof/ppm.htm
http://puppylinux.com/woof/pkg-db-format.htm

When you use the 'dir2pet' utility in Woof-pup, it runs the 'petspec' utility and creates a pkg db entry in the new format.
Woof also has a utility for converting the old 'packages.txt' format to the new one.
[url]https://bkhome.org/news/[/url]

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

#312 Post by gpnet »

Hi , Barry

Thank you for the post. I'll try to read and make some changes to my experimental vala pgm.

I also fight whit glade3 , but in some way , I think something turns out.

Giorgio

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

#313 Post by gpnet »

Hi Barry,

So Barry , If I well understood there are serveral changes to the general logic. In order to the job I want to do I think I have to consider a couple o things. In detail :

1. the words on/of are gone
2. the file deadpackages.txt,PBG_rettags.txt are gone.
3. the file's entry in each .files are not needed, just directories.

-this means if one want to reinstall a package , it must install from the original repo from a list of repos
-this means if one want unistall a package must delete all files in specific dir enumerating the content and recurring the subdirs.

All this is correct, Do I forget something ?

What about backup files ? Do you have any suggestion ?.

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

Notebook Test

#314 Post by nikobordx »

Hi all,

New simple test of Notebook !

Code: Select all

[indent=4]

/* Build with valac --pkg gtk+-2.0 yourfile.gs */

uses
    Gtk

init
    Gtk.init (ref args)
    var test = new NotebookTest ()
    test.show_all ()
    Gtk.main ()

class NotebookTest : Window

    notebook : Notebook
    delete_button : ToolButton
    status_bar : Statusbar

    init
        title = "Simple Notebook Test"
        default_height = 350
        default_width = 500
        window_position = WindowPosition.CENTER
        destroy += on_exit_clicked
        var toolbar = new Toolbar ()
        var new_button = new ToolButton.from_stock (STOCK_NEW)
        delete_button = new ToolButton.from_stock (STOCK_DELETE)
        var prev_button = new ToolButton.from_stock (STOCK_GO_BACK)
        var next_button = new ToolButton.from_stock (STOCK_GO_FORWARD)
        var quit_button = new ToolButton.from_stock (STOCK_QUIT)
        toolbar.add (new_button)
        toolbar.add (delete_button)
        toolbar.add (prev_button)
        toolbar.add (next_button)
        toolbar.add (quit_button)
        new_button.clicked += on_new_clicked
        delete_button.clicked += on_delete_clicked
        delete_button.sensitive = false
        prev_button.clicked += on_prev_page_clicked
        next_button.clicked += on_next_page_clicked
        quit_button.clicked += on_exit_clicked
        notebook = new Notebook()
        notebook.set_tab_pos(PositionType.BOTTOM)
        notebook.set_show_tabs(true)
        notebook.set_show_border(true)
        status_bar = new Statusbar ()
        status_bar.set_has_resize_grip (false)
        status_bar.pop(0)
        status_bar.push(0, "Click 'New' to add tabs !")
        var vbox = new VBox (false, 0)
        vbox.pack_start (toolbar, false, true, 0)
        vbox.pack_start (notebook, true, true, 0)
        vbox.pack_start (status_bar, false, true, 0)
        add (vbox)

    def private on_new_clicked ()
        delete_button.sensitive = true
        var frame = new Frame("I'm a frame in a notebook !!!")
        frame.set_border_width(10)
        frame.set_size_request(100, 75)
        frame.show()
        var label = new Label("Page " + notebook.get_n_pages().to_string())
        notebook.append_page(frame, label)
        notebook.child_set (frame, "tab-expand", true, null)
        notebook.show_all()
        notebook.set_current_page(notebook.get_n_pages()-1)
        number_of_pages ()

    def private on_delete_clicked ()
        numberofpage : int = notebook.get_current_page() - 1
        if numberofpage is -1
            delete_button.sensitive = false
            delete_pages_clicked ()
            number_of_pages ()
        else
            delete_pages_clicked ()
            number_of_pages ()

    def private delete_pages_clicked ()
        notebook.remove_page(notebook.get_current_page())
        number_of_pages ()

    def private on_next_page_clicked ()
        notebook.next_page()

    def private on_prev_page_clicked ()
        notebook.prev_page()

    def private on_exit_clicked ()
        print("See you !!!")
        Gtk.main_quit()

    def private number_of_pages ()
        status_bar.push(0, "Number of pages: " + notebook.get_n_pages().to_string())
Nicolas.

gege2061
Posts: 4
Joined: Sat 21 Mar 2009, 00:59
Location: France
Contact:

#315 Post by gege2061 »

Hello ;)

I am pleased to announce the next release of Val(a)IDE with support for genie!

Val(a)IDE 0.5

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

#316 Post by BarryK »

gpnet wrote:Hi Barry,

So Barry , If I well understood there are serveral changes to the general logic. In order to the job I want to do I think I have to consider a couple o things. In detail :

1. the words on/of are gone
2. the file deadpackages.txt,PBG_rettags.txt are gone.
3. the file's entry in each .files are not needed, just directories.

-this means if one want to reinstall a package , it must install from the original repo from a list of repos
-this means if one want unistall a package must delete all files in specific dir enumerating the content and recurring the subdirs.

All this is correct, Do I forget something ?

What about backup files ? Do you have any suggestion ?.
The .files files are as before, except they ALSO contain directory entries as well as file entries. The Easiest thing is to run a Woof build and use the Puppy Packge Manager to install a package. then take a look in /root/.packages.
[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:

#317 Post by BarryK »

nikobordx wrote:Hi all,

New version without warning !

Nicolas.
Nicolas,
I compiled this in my latest Woof build Upup, which has gtksourceview, but the text editor does not display any syntax highlighting.
...is this part of it still not implemented?
[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:

#318 Post by BarryK »

gege2061 wrote:Hello ;)

I am pleased to announce the next release of Val(a)IDE with support for genie!

Val(a)IDE 0.5
Ah, I've just realised why I can't compile it, my system has gtk 2.14.7.
Is it possible to not be reliant on gtk >= 2.16.x?
[url]https://bkhome.org/news/[/url]

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

New version of Text Editor

#319 Post by nikobordx »

Hi all,

This is a new version with "line number" and "syntax highlighting" support !!!

You need the new gtksourceview to make compile !

Please test it !
Nicolas.
Attachments
gtksourceview-2.0.vapi.tar.gz
(2.3 KiB) Downloaded 453 times
texteditor.gs.tar.gz
(4.44 KiB) Downloaded 419 times

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

Libnotify test

#320 Post by nikobordx »

Re - Hi all !

New test, libnotify:

Code: Select all

[indent=4]

/* Build with valac --pkg gtk+-2.0 --pkg libnotify yourfile.gs */

uses
    Gtk
    Notify

init
    Gtk.init (ref args)
    var test = new NotifyTest ()
    Notify.init("test")
    test.show_all ()
    test.low_clicked ()
    test.normal_clicked ()
    test.critical_clicked ()
    Gtk.main ()

class NotifyTest : Window

    init
        title = "Simple Notify Test"
        default_height = 45
        default_width = 115
        window_position = WindowPosition.CENTER
        destroy += exit_app
        var low_button = new Button.with_label("LOW")
        low_button.clicked += low_clicked
        var normal_button = new Button.with_label ("NORMAL")
        normal_button.clicked += normal_clicked
        var critical_button = new Button.with_label ("CRITICAL")
        critical_button.clicked += critical_clicked
        var quit_button = new Button.from_stock (STOCK_QUIT)
        quit_button.clicked += exit_app
        var hbox = new HBox (false, 0)
        hbox.pack_start (low_button, false, true, 0)
        hbox.pack_start (normal_button, false, true, 0)
        hbox.pack_start (critical_button, false, true, 0)
        hbox.pack_start (quit_button, false, true, 0)
        add (hbox)

    def low_clicked ()
        var notification = new Notification ("Notify Test", "This is a LOW test", "icon_name", null)
        notification.set_timeout(5000)
        notification.set_urgency(Notify.Urgency.LOW)
        try
            notification.show()
        except ex : GLib.Error
            print("Unable to show low notification")

    def normal_clicked ()
        var notification = new Notification ("Notify Test", "This is a NORMAL test", "icon_name", null)
        notification.set_timeout(5000)
        notification.set_urgency(Notify.Urgency.NORMAL)
        try
            notification.show()
        except ex : GLib.Error
            print("Unable to show normal notification")

    def critical_clicked ()
        var notification = new Notification ("Notify Test", "This is a CRITICAL test", "icon_name", null)
        notification.set_timeout(5000)
        notification.set_urgency(Notify.Urgency.CRITICAL)
        try
            notification.show()
        except ex : GLib.Error
            print("Unable to show critical notification")

    def private exit_app ()
        Notify.uninit ()
        Gtk.main_quit()
See you,
Nicolas.

Post Reply