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:

#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.

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

StatusIcon test

#321 Post by nikobordx »

Oop's, a new test, StatusIcon:

Code: Select all

[indent=4]

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

uses
    Gtk

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

class StatusIconTest : Window

    trayicon : StatusIcon
    menu : Menu

    init
        title = "StatusIcon"
        window_position = WindowPosition.CENTER
        set_resizable(false)
        destroy += exit_app
        var label = new Label("Look the house in your taskbar !!!")
        var hbox = new HBox (false, 0)
        hbox.pack_start (label, false, true, 0)
        add (hbox)

        /* Create tray icon */
        trayicon = new StatusIcon.from_stock(STOCK_HOME)
        trayicon.set_tooltip_text ("Hello, i'm a tooltip !")
        trayicon.set_visible(true)
        trayicon.activate += icon_clicked
        create_menu()

        /* Create menu */
    def private create_menu ()
        menu = new Menu()
        var menuItem = new ImageMenuItem.from_stock(STOCK_ABOUT, null)
        menuItem.activate += about_clicked
        menu.append(menuItem)
        var menuItem2 = new ImageMenuItem.from_stock(STOCK_QUIT, null)
        menuItem2.activate += exit_app
        menu.append(menuItem2)
        menu.show_all()
        trayicon.popup_menu += def (button, time)
            show_popup(button, time)

        /* Show popup menu */
    def private show_popup (button : uint, time : uint)
        menu.popup(null, null, null, button, time)

    def private icon_clicked ()
        print("I know you have clicked on the icon !!")

def private about_clicked ()
        var about = new AboutDialog ()
        about.set_version("1.0")
        about.set_program_name("Simple StatusIcon Test")
        about.set_comments("This is a Simple StatusIcon Test")
        about.set_copyright("Nicolas alias nikobordx")
        about.run()
        about.hide()

    def private exit_app ()
        Gtk.main_quit()
I don't know what to test now ! :( if someone have an idea ... :D
Nicolas.

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

Genie SDK

#322 Post by nikobordx »

Hi,

For all persons interested, I created a small sdk of my genie test !

Nicolas.
Attachments
GenieSamples.tar.gz
(12.8 KiB) Downloaded 543 times

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

Re: New version of Text Editor

#323 Post by BarryK »

nikobordx wrote: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.
Nicolas,
Yes, I now have syntax highlighting!

When I open a file from the commandline, for example:
# simpletexteditor demo.htm

It opens at the end of the file. Can this be fixed?


Starting the editor in a terminal, without specifying any file on the commandline, I see this warning:

Code: Select all

** (simpletexteditor:2615): CRITICAL **: text_file_viewer_open_file: assertion `filename != NULL' failed
Unable to delete temp file, anyway it's not important !
...does that matter?

Note, I'm running my latest Woof-built "413", based on Puppy 412 with upgrades, GTK 2.14.7.
[url]https://bkhome.org/news/[/url]

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

#324 Post by nikobordx »

Hi Barry,

I have the same, can you try this:
Delete this line: text_view.scroll_to_mark (buf.get_insert (), 0.25, false, 0.0, 0.0)
Rebuild and test !

I ask you because I updated vala (version 0.7.4) and I can't compile the texteditor anymore.

Code: Select all

texteditor.gs:567.61-567.67: error: Argument 3: Cannot convert from `ulong' to `int'
                FileUtils.get_contents (filename, out text, out len)
Nicolas.

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

#325 Post by nikobordx »

Re-Hi Barry,

Ok i found a solution.
Under the function:

Code: Select all

 def open_file (filename : string) 
Add this:

Code: Select all

 go_to_line(1)
Before the line:

Code: Select all

 status_bar.push(0, "You are editing: " + filename) 
See you,
Nicolas.

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

SDK

#326 Post by nikobordx »

[Message Deleted]

See more recent message !

Nicolas.
Last edited by nikobordx on Mon 15 Jun 2009, 20:41, edited 1 time in total.

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

#327 Post by nikobordx »

Hi all,
This is a new version of sdk.

25 examples and 3 complete app !

See you,
Nicolas.
Attachments
GenieSamples.tar.gz
(58.6 KiB) Downloaded 527 times

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

#328 Post by gege2061 »

BarryK wrote: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?
You can try with the attached patch ;)
Attachments
gtk-2.14.patch.tar.gz
Patch for use valide with GTK+ 2.14
(640 Bytes) Downloaded 472 times

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

#329 Post by BarryK »

Nicolas,
I inserted the line as you instructed above, it doesn't fix it. I now have two bugs to report with the simple text editor:

1
Chose to exit editor, file was changed, a dialog came up:
"The file is unregistered, do you want to save it?"
...clicking No or Yes buttons, nothing happens.

2.
Open a file on commandline, window displays end of file. The recommended fix
inserting go_to_line(1) did not work. The insertion point is at the beginning of the file, but it initially displays the end of the file.


...if you can fix these, I propose to replace Leafpad in Puppy. I would also like to rename the simple text editor as "NicEdit" if that's ok with you.
[url]https://bkhome.org/news/[/url]

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

#330 Post by nikobordx »

[Message Deleted]

See next message !

Nicolas.
Last edited by nikobordx on Mon 15 Jun 2009, 19:46, edited 1 time in total.

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

NicEdit

#331 Post by nikobordx »

[Message deleted]

See newer message !

Nicolas.
Last edited by nikobordx on Thu 18 Jun 2009, 15:06, edited 1 time in total.

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

#332 Post by BarryK »

Nicolas,

A problem, I cannot get ValIDE to compile:

http://puppylinux.com/blog/?viewDetailed=00814

I love NicEdit, see my post, and a problem with syntax highlighting:

http://puppylinux.com/blog/?viewDetailed=00810
[url]https://bkhome.org/news/[/url]

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

#333 Post by nikobordx »

See more recent message !

Nicolas.
Last edited by nikobordx on Sat 20 Jun 2009, 20:21, edited 1 time in total.

User avatar
samedog
Posts: 56
Joined: Sun 12 Oct 2008, 11:03
Location: Panguipulli,Chile
Contact:

#334 Post by samedog »

Hi everyoine, i need a little help with a problem:

i have downloaded the GieneExamples by MU, after looking at the picturebrowseri decided to make some changes to to it (i just translate some buttons labels to spanish) after that i compiled it (with the compile button in the valide program) and everything was fine. After that i run the program, clicked on one folder on the tree and the program crashes with a "segmentation fault"

i have downloaded all from http://dotpups.de/puppy4/dotpups/Programming/Vala/

reinstalled lots of times, but nothing seems to work.

i have also tried to compile the GenieExamples program, with the same results: when i click a folder on the tree, the program crashes with seg. fault

i'm using puppy 4.00, and i have installed the following packages:

libgee-0.1.5.pet
libgee_DEV-0.1.5.pet
vala-0.7.2-i486.pet
valide-0.4-1-i686-svn-2009-03-27-and-gedit.pet
gtksourceview-2.4.2.pet
ORBit2-2.14.7-i686.pet
GConf-2.18.0.1-i686.pet


now i'm gonna try to compile from source and see what happens, but if someone can help me it would be very nice.


greetings.
<Rupp>ERROR: Communication problem with khotkeys, it probably crashed.
<Rupp>damn
<samedog>EPIC
<Rupp>FAIL
<samedog>hmm... pretty good for a signature..
<Rupp>XD

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

#335 Post by nikobordx »

[See newer message]

Nicolas.
Last edited by nikobordx on Mon 22 Jun 2009, 17:59, edited 1 time in total.

Post Reply