Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 29 Aug 2014, 20:41
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Vala and Genie programming
Post new topic   Reply to topic View previous topic :: View next topic
Page 34 of 35 [517 Posts]   Goto page: Previous 1, 2, 3, ..., 32, 33, 34, 35 Next
Author Message
growler


Joined: 24 Mar 2008
Posts: 209
Location: Kapiti - New Zealand

PostPosted: 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
View user's profile Send private message 
nikobordx

Joined: 23 May 2009
Posts: 84
Location: Bordeaux, France

PostPosted: 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
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4346

PostPosted: 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)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
hoggie

Joined: 05 Dec 2010
Posts: 1

PostPosted: 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
View user's profile Send private message Visit poster's website 
foxtwo

Joined: 07 Jan 2010
Posts: 1

PostPosted: 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
View user's profile Send private message 
Liboicl

Joined: 15 Feb 2010
Posts: 90

PostPosted: 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
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6428
Location: Auckland, New Zealand

PostPosted: 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...
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4346

PostPosted: 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)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
RedRavid

Joined: 26 Feb 2011
Posts: 1

PostPosted: 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
View user's profile Send private message 
Liboicl

Joined: 15 Feb 2010
Posts: 90

PostPosted: 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
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: 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 WIKI
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6428
Location: Auckland, New Zealand

PostPosted: 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.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Tue 01 Mar 2011, 01:53    Post subject:  

Code:
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 Cool

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6428
Location: Auckland, New Zealand

PostPosted: Tue 01 Mar 2011, 15:55    Post subject:  

But can you login and run X and everything as a limited user?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 2333
Location: New Zealand

PostPosted: 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)

_________________
Non enim propter gloriam, diuicias aut honores pugnamus set propter libertatem solummodo quam Nemo bonus nisi simul cum vita amittit.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 34 of 35 [517 Posts]   Goto page: Previous 1, 2, 3, ..., 32, 33, 34, 35 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0929s ][ Queries: 12 (0.0123s) ][ GZIP on ]