Author |
Message |
growler

Joined: 24 Mar 2008 Posts: 209 Location: Kapiti - New Zealand
|
Posted: Wed 22 Sep 2010, 02:50 Post subject:
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...
|
Back to top
|
|
 |
nikobordx
Joined: 23 May 2009 Posts: 84 Location: Bordeaux, France
|
Posted: Thu 07 Oct 2010, 06:25 Post subject:
Close file |
|
Hi Mobeus and other,
In fact you can close the file if you want !
Use pointer !
Code: |
[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.
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Mon 11 Oct 2010, 16:59 Post subject:
|
|
@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: | 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)
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
hoggie
Joined: 05 Dec 2010 Posts: 1
|
Posted: Sun 05 Dec 2010, 15:17 Post subject:
how to connect signals? |
|
Many of the existing code examples contain depricated code by connecting Signals.
i.E.
Code: | destroy += Gtk.main_quit |
is replaced by
Code: | destroy.connect(Gtk.main_quit) |
but i didn't find out how to repace the following Syntax:
Code: |
button.clicked += def (btn)
title = "Hello World"
btn.label = "Hello World"
|
Has anyone a Idea how to do this?
|
Back to top
|
|
 |
foxtwo
Joined: 07 Jan 2010 Posts: 1
|
Posted: Fri 24 Dec 2010, 05:12 Post subject:
hello-gtk Subject description: connect |
|
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"
|
Back to top
|
|
 |
Liboicl
Joined: 15 Feb 2010 Posts: 90
|
Posted: Fri 31 Dec 2010, 17:07 Post subject:
|
|
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
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 7024 Location: Auckland, New Zealand
|
Posted: Tue 18 Jan 2011, 19:22 Post subject:
|
|
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
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 4878 Location: Blue Springs, MO
|
Posted: Tue 08 Feb 2011, 15:37 Post subject:
|
|
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)
_________________ Check out my github repositories. I may eventually get around to updating my blogspot.
|
Back to top
|
|
 |
RedRavid
Joined: 26 Feb 2011 Posts: 1
|
Posted: Sat 26 Feb 2011, 16:30 Post subject:
Automated Universal Installer preposal Subject description: Should I make an Automated Universal Installer |
|
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.
|
Back to top
|
|
 |
Liboicl
Joined: 15 Feb 2010 Posts: 90
|
Posted: Mon 28 Feb 2011, 18:38 Post subject:
|
|
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.
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15588 Location: Paradox Realm
|
Posted: Mon 28 Feb 2011, 22:07 Post subject:
|
|
Quote: | 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
_________________ Puppy Raspup 8.2 Final
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html 
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 7024 Location: Auckland, New Zealand
|
Posted: Tue 01 Mar 2011, 01:22 Post subject:
|
|
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
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15588 Location: Paradox Realm
|
Posted: Tue 01 Mar 2011, 01:53 Post subject:
|
|
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
_________________ Puppy Raspup 8.2 Final
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html 
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 7024 Location: Auckland, New Zealand
|
Posted: Tue 01 Mar 2011, 15:55 Post subject:
|
|
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
|
Back to top
|
|
 |
mcewanw
Joined: 16 Aug 2007 Posts: 3200
|
Posted: Sun 17 Apr 2011, 00:59 Post subject:
Pcreole can be used as a programming/compiling environment |
|
http://www.murga-linux.com/puppy/viewtopic.php?p=513392#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
|
Back to top
|
|
 |
|