Page 25 of 26

Geany with Genie syntax highlightling

Posted: Wed 22 Sep 2010, 06:50
by growler
I have been using Nicolas's Nicoedit but I have previously used geany and become accustomed to it's short-cuts for indentation etc... it may be chunckier but I am not good with different.

The geany guys have made my day with syntax highlighting for genie!! In case others wish to know...

Close file

Posted: Thu 07 Oct 2010, 10:25
by nikobordx
Hi Mobeus and other,

In fact you can close the file if you want !
Use pointer !

Code: Select all

 [indent=4]

init
    fn : string = "/tmp/test.sh"
    doit(fn)
   
def doit (filename : string)
    fp0 : FileStream* = FileStream.open (filename, "w")
    fp1 : unowned FileStream = fp0
    fp1.puts ("ls /root")
    fp1.flush()
    delete(fp0) // Close the file !
    FileUtils.chmod (filename, 0750)
    try
        Process.spawn_command_line_async (filename)
    except ex : GLib.Error
        print ("%s", ex.message)
I hope this is correct.

See you,
Nicolas.

Posted: Mon 11 Oct 2010, 20:59
by technosaurus
@all - improved gtkbuilder example
This one works with the default values from glade3 and uses a user input gtkbuilder xml file (from glade)

//save as gtkbox.vala

Code: Select all

using Gtk;

int main (string[] args) {     
    Gtk.init (ref args);

    try {
        var builder = new Builder ();
        builder.add_from_file (args[1]);
        builder.connect_signals (null);
        var window = builder.get_object ("window1") as Window;
        window.destroy.connect(Gtk.main_quit);
        window.show_all ();
        Gtk.main ();
    } catch (Error e) {
        stderr.printf ("Could not load UI: %s\n", e.message);
        return 1;
    }
    return 0;
}

to build:
valac --pkg gtk+-2.0 --pkg gmodule-2.0 gtkbox.vala

to run:
./gtkbox anygtkbuilderui

Note: glade sets the gtkwindow id to window1 - don't change it
... may change it later to require the id to be the same as the basename of the ui file (if I can figure out basename in vala)

how to connect signals?

Posted: Sun 05 Dec 2010, 19:17
by hoggie
Many of the existing code examples contain depricated code by connecting Signals.
i.E.

Code: Select all

destroy += Gtk.main_quit
is replaced by

Code: Select all

destroy.connect(Gtk.main_quit)
but i didn't find out how to repace the following Syntax:

Code: Select all

button.clicked += def (btn)
	title = "Hello World"
	btn.label = "Hello World"
Has anyone a Idea how to do this?

hello-gtk

Posted: Fri 24 Dec 2010, 09:12
by foxtwo
How about this code?

[indent=4]
/* Build with valac --pkg gtk+-2.0 hello-gtk.gs
valac --version 0.7.4 */
uses
Gtk

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

class TestWindow : Window

button : Button

init
title = "Test Window"
default_height = 250
default_width = 250
window_position = WindowPosition.CENTER
destroy.connect (Gtk.main_quit)
button = new Button.with_label("Click Me")
button.clicked.connect (btnclick)
add(button)

def btnclick ()
title = "you have clicked"
button.label = "Hello World"

Posted: Fri 31 Dec 2010, 21:07
by Liboicl
I made a simple HTTP wrapper for gene and almost lost it when some data accidentally got deleted from my hard drive. I decided to dedicate a section on my site to source code, so if anyone wants to look at it here it is. If I make anything else that I think might serve a use to others I will upload it here also.

ftp://ftp.tehgroup.org/
-or-
http://ftp.tehgroup.org

Posted: Tue 18 Jan 2011, 23:22
by disciple
Liboicl - should those addresses still work? The ftp asks for a user name and password, and the http just gives an error page...

Posted: Tue 08 Feb 2011, 19:37
by technosaurus
I am considering making this feature request:

"Change the name of vala to "Pencil"
...It just seems more correct...
  • User: What did you write it in?
    Me: Pencil
    User: Oh.... so that's why you need to keep rewriting it - it must be fading
    Me: Something like that.
Warning: convert your vala code to C before you upgrade to a new version of vala (in other words make an "ink" copy)

Automated Universal Installer preposal

Posted: Sat 26 Feb 2011, 20:30
by RedRavid
The existing Universal Installer asks questions it doesn't need to.
For example it gives a list of all the possible installation media when it could detect what you have available instead.
So do you think i should create AUI and do you have any other suggestions.
P.S I would like to write it in Genie code.

Posted: Mon 28 Feb 2011, 22:38
by Liboicl
disciple wrote:Liboicl - should those addresses still work? The ftp asks for a user name and password, and the http just gives an error page...
My server was taken down. If anyone has a suggestion of a good cheap host I can have the code back up quickly.

Posted: Tue 01 Mar 2011, 02:07
by Lobster
So do you think i should create AUI and do you have any other suggestions.
Go for it
My suggestion is an easy toggle for the
'Do not run as root' drones,
so they can they switch between
root and password restricted user status

Posted: Tue 01 Mar 2011, 05:22
by disciple
That's all very well lobster, but Puppy needs to be set up first so that he can run as a restricted user.

Posted: Tue 01 Mar 2011, 05:53
by Lobster

Code: Select all

rxvt -e su spot
will allow you to run as user spot

Kirk in fatdog also ensures downloads
to a download folder,
that might be a good program toggle

Another useful program might allow one to edit the menus
or use various preselects, such beginner, simple, advanced 8)

Posted: Tue 01 Mar 2011, 19:55
by disciple
But can you login and run X and everything as a limited user?

Pcreole can be used as a programming/compiling environment

Posted: Sun 17 Apr 2011, 04:59
by mcewanw
http://www.murga-linux.com/puppy/viewto ... 392#513392
mcewanw wrote:Latest version uploaded:
Pcreole 1.0.2

Changes:
- The "t" button now opens both an rxvt and a rox filemanager window at the selected directory.
- many extra commandlines (and some fixed old ones) with brief explanation header added to the Combo box list
- find more commands to add yourself from, for example, http://www.commandlinefu.com/
----

Note that Pcreole, with a suitable commandline etc, is also designed to provide a (unsophisticated) programming environment for compiling (e.g. with gcc, Vala, Genie etc)

Posted: Thu 26 Apr 2012, 14:48
by Mobeus
Where can I get the latest version of Vala for Puppy Lucid 5.28?

The last two versions are 0.15.2 and 0.16.0

Thanks

Posted: Thu 26 Apr 2012, 16:57
by Lobster

Posted: Thu 26 Apr 2012, 17:26
by Mobeus
Thanks

However the version at dotpups.de is 0.7.5 and the one at bkhome.org is 0.9.1. The one in my Lucid 5.11 is 0.9.2

Perhaps I should have asked if there is a pet or binary tarball available for a newer version of Vala?

Posted: Thu 12 Jul 2012, 19:40
by MU
http://dotpups.de/puppy4/dotpups/Progra ... fluppy013/

Vala 0.12 and Valide 0.7.1.
There is a Vala 0.18 or so already, but the IDE requires 0.12.

Compiled in Fluppy 013, so might work or not in dpup or other puplets. I just use Fluppy at moment.

The "Crashfix" pet I needed on my netbook with a freshly set up system, because valide 0.7.1 crashes with a gtksourceview error, when I try to open a .gs file with the internal editor.

With the fix it works, it replaces the autocompletion with the older one from valide 0.4.

On my desktop system this is not required, but I actually cannot reproduce why.

I also uploaded a Picturebrowser 0.7 as a standalone setup for Windows 7 64 Bit.
It fixes a memory error on Windows and includes all required Gtk2 DLLs.

http://dotpups.de/puppy4/dotpups/Progra ... tandalone/

Mark

How to internazionalize genie application?

Posted: Mon 03 Jun 2013, 17:09
by txasatonga
I know there is a Sampala vala example in Gitup page. But i cant understand it at all.
Can any one explain how to internazionalize using Glib.intl a genie application?
Thanks.