Vala and Genie programming
Geany with Genie syntax highlightling
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...
The geany guys have made my day with syntax highlighting for genie!! In case others wish to know...
Close file
Hi Mobeus and other,
In fact you can close the file if you want !
Use pointer !
I hope this is correct.
See you,
Nicolas.
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)
See you,
Nicolas.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
@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
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)
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;
}
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)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
how to connect signals?
Many of the existing code examples contain depricated code by connecting Signals.
i.E.
is replaced by
but i didn't find out how to repace the following Syntax:
Has anyone a Idea how to do this?
i.E.
Code: Select all
destroy += Gtk.main_quit
Code: Select all
destroy.connect(Gtk.main_quit)
Code: Select all
button.clicked += def (btn)
title = "Hello World"
btn.label = "Hello World"
hello-gtk
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"
[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"
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
ftp://ftp.tehgroup.org/
-or-
http://ftp.tehgroup.org
Liboicl - should those addresses still work? The ftp asks for a user name and password, and the http just gives an error page...
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I am considering making this feature request:
"Change the name of vala to "Pencil"
...It just seems more correct...
"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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Automated Universal Installer preposal
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.
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.
That's all very well lobster, but Puppy needs to be set up first so that he can run as a restricted user.
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Code: Select all
rxvt -e su 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
But can you login and run X and everything as a limited user?
Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
Pcreole can be used as a programming/compiling environment
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)
github mcewanw
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
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
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
-
- Posts: 2
- Joined: Thu 28 Jun 2012, 01:49
- Contact:
How to internazionalize genie application?
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.
Can any one explain how to internazionalize using Glib.intl a genie application?
Thanks.