Vala and Genie programming
you should be able to compile main.gs on every puppy, I used nothing special in it.
Just if you run the executable without recompiling it, you might get an error, as NYP uses more libs in general.
For this reason I compile programs I want to share usually in Puppy 4.12.
I just did not do it here, as for you it should be easy to compile it yourself
If you still get errors, I would need the exact message.
Mark
Just if you run the executable without recompiling it, you might get an error, as NYP uses more libs in general.
For this reason I compile programs I want to share usually in Puppy 4.12.
I just did not do it here, as for you it should be easy to compile it yourself
If you still get errors, I would need the exact message.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
You may not need a thread for updating the label. I think something along the lines of after each set_text would suffice.
However care must be taken not to enter a second (a third etc) that click handler (because main_iteration () will process clicks too, and you would have one click handler's main_iteration () call re-entering the click handler..)
Or, if your really want a thread, you have to 'post' the work (set_text) to be done in the UI thread using GLib.Idle.add ().
Code: Select all
if (Gtk.events_pending())
Gtk.main_iteration ()
However care must be taken not to enter a second (a third etc) that click handler (because main_iteration () will process clicks too, and you would have one click handler's main_iteration () call re-entering the click handler..)
Or, if your really want a thread, you have to 'post' the work (set_text) to be done in the UI thread using GLib.Idle.add ().
Vlad,
oh, things can be so easy!
I attach a new "Lobster1.tar.gz", that works as you described.
I also added a lock.
There is a strange sideeffect though:
when I close one of both windows, the program does not exit, until the loop finished.
Maybe another check had to be added, but I'm too tired now.
I also just finished a full working solution using Threads and a Mutex.
Main.gs includes some comments.
I attach it, too, and post the source here, so that I quickly can look it up later.
Many thanks for "Gtk.main_iteration", I often missed such a simple solution. It will make life easier for me in future
Mark
oh, things can be so easy!
I attach a new "Lobster1.tar.gz", that works as you described.
I also added a lock.
There is a strange sideeffect though:
when I close one of both windows, the program does not exit, until the loop finished.
Maybe another check had to be added, but I'm too tired now.
I also just finished a full working solution using Threads and a Mutex.
Main.gs includes some comments.
I attach it, too, and post the source here, so that I quickly can look it up later.
Many thanks for "Gtk.main_iteration", I often missed such a simple solution. It will make life easier for me in future
Mark
Code: Select all
[indent=4]
/*
This example updates a gtkwindow, that executes a long loop
Usually, during a loop, the window is not updated
The solution is to use "threads" and a "mutex"
!!!!! compile it in a console like this: !!!!!
valac --thread --pkg gtk+-2.0 main.gs -o GtkThreads
other examples:
http://ubuntuforums.org/archive/index.php/t-323435.html (C)
see also: http://valadoc.org/?pkg=glib-2.0&element=GLib.Thread
*/
//outputting random generated text from input and outputting result
uses
GLib
//-- declare global variables --
entry : Gtk.Entry
label : Gtk.Label
mutex : Mutex
locked : bool
//-- define the methods --
def getRandomNumber(RangeFrom:int, RangeTo:int) : int /* function to create random number between range */
return GLib.Random.int_range(RangeFrom,RangeTo)
def getRandomChar() : char /* function to generate ascii codes from a-z and space (32) */
num:int = getRandomNumber(0,27)
if num == 0
num = 32
else
num = num + 96
return (char) num
def addRandomChar(myText:string) : string /* function add text from command line */
var retText = new StringBuilder
retText.append(myText)
retText.append_c(getRandomChar())
return retText.str
def IsEmpty(theText:string) : bool
if theText == null
return true
if theText == ""
return true
return false
def mythread() :int
theText:string = entry.get_text()
if IsEmpty(theText)
entry.set_text("Please enter some text")
return 1
locked = true
label.set_text("running")
//Gdk.flush()
theText = theText.down()
myText:string = ""
timer : Timer = new Timer()
timer.start()
do
do
myText = addRandomChar(myText)
while theText.len() != myText.len()
mutex.lock ()
Gdk.threads_enter()
label.set_text(myText)
Gdk.threads_leave()
mutex.unlock()
if theText != myText
myText = ""
while theText != myText
label.set_text( myText )
locked = false
return 0
def mythread2() : int
for var i = 1 to 100
print ("%s" , "+++")
Thread.usleep(100)
return 0
def static on_button_clicked ()
if locked == true
print("%s" , "thread is locked")
return
try
Thread.create( (ThreadFunc)mythread, false)
except ex : GLib.ThreadError
print ("threaderror!")
//Thread.create( (ThreadFunc)mythread2, false)
//-- main program --
init
Gdk.threads_init()
Gtk.init (ref args)
mutex = new Mutex ()
//-- build the first window --
var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (400, 50)
window.destroy += Gtk.main_quit
window.set_title("userinput")
window.move(100 , 100)
var vbox = new Gtk.VBox(false , 1)
vbox.border_width = 10
vbox.spacing = 10
window.add (vbox)
//-- the entry is global, so that it can be modified later --
entry = new Gtk.Entry ()
entry.set_editable(true)
entry.set_text("test")
vbox.pack_start (entry, false, true, 0)
var button = new Gtk.Button.with_label("enter some SHORT text (less 10 chars), then click here!")
vbox.pack_start (button, false, true, 0)
//-- define actions --
button.clicked += on_button_clicked;
//------ window 2 -----------
var window2 = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window2.set_default_size (400, 50)
window2.destroy += Gtk.main_quit
window2.set_title("results")
window2.move(100 , 250)
var vbox2 = new Gtk.VBox(false , 1)
vbox2.border_width = 10
vbox2.spacing = 10
window2.add (vbox2)
label = new Gtk.Label ("")
vbox2.pack_start (label, false, true, 0)
//-- show the window, hand over to the Gtk mainloop --
window2.show_all ()
window.show_all ()
Gdk.threads_enter()
Gtk.main ()
Gdk.threads_leave()
- Attachments
-
- GtkThreads.tar.gz
- (7.5 KiB) Downloaded 600 times
-
- Lobster1.tar.gz
- (6.32 KiB) Downloaded 604 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
http://puppylinux.asia/members/T/486_pe ... 1-i486.pet
source date 12 april
source date 12 april
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].
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Genie bugs fixed, request for help, see my blog post:
http://puppylinux.com/blog/?viewDetailed=00656
http://puppylinux.com/blog/?viewDetailed=00656
[url]https://bkhome.org/news/[/url]
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Just reporting in . . .
Mark,
Shadow rather liked your iso with Mono and Valide
http://www.murga-linux.com/puppy/viewto ... 970#290970
Valide in this configuration, maybe because you are using Opera, did not effect the browser. I am reluctant to use valide on anything but a test setup. Quite happy to use Geany or Mhedit for now in 4.2
Anyway I gave him a copy - hope it works on his system. He programs in c# - has some interesting routines. Will see what happens.
Mark,
Shadow rather liked your iso with Mono and Valide
http://www.murga-linux.com/puppy/viewto ... 970#290970
Valide in this configuration, maybe because you are using Opera, did not effect the browser. I am reluctant to use valide on anything but a test setup. Quite happy to use Geany or Mhedit for now in 4.2
Anyway I gave him a copy - hope it works on his system. He programs in c# - has some interesting routines. Will see what happens.
I uploaded the git version of Vala:
http://dotpups.de/puppy4/dotpups/Progra ... 5-i486.pet
Compiled in Puppy 4.12.
Source:
http://dotpups.de/puppy4/dotpups/Progra ... source.tgz
Barry wrote details, it includes new fixes for Genie:
http://puppylinux.com/blog/?viewDetailed=00656
Mark
http://dotpups.de/puppy4/dotpups/Progra ... 5-i486.pet
Compiled in Puppy 4.12.
Source:
http://dotpups.de/puppy4/dotpups/Progra ... source.tgz
Barry wrote details, it includes new fixes for Genie:
http://puppylinux.com/blog/?viewDetailed=00656
Mark
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Thanks Mark - have upgraded.
will compile something in a moment to make sure it is working
Many thanks.
Am I right in thinking your source code should go in Puppy git?
http://git.puppylinux.ca/git/?p=puppy.git;a=summary
. . . and also maybe a Puppy style front end to git
could be written in Genie by some intrepid soul?
vala/genie are to be in 4.2.1 devx
I have also this stub at the ready for those able to simplify Pizzasgoods extensive info on git
http://www.puppylinux.org/wiki/developm ... dvancedgit
and posted to pizzasgood thread
http://www.murga-linux.com/puppy/viewto ... 347#295347
This would seem to be an ideal test opportunity on a number of levels.
Create / code / become gitters (so to speak)
will compile something in a moment to make sure it is working
Many thanks.
Am I right in thinking your source code should go in Puppy git?
http://git.puppylinux.ca/git/?p=puppy.git;a=summary
. . . and also maybe a Puppy style front end to git
could be written in Genie by some intrepid soul?
vala/genie are to be in 4.2.1 devx
I have also this stub at the ready for those able to simplify Pizzasgoods extensive info on git
http://www.puppylinux.org/wiki/developm ... dvancedgit
and posted to pizzasgood thread
http://www.murga-linux.com/puppy/viewto ... 347#295347
This would seem to be an ideal test opportunity on a number of levels.
Create / code / become gitters (so to speak)
I attach a pet with a Automount program,
It shows well, how great Genie is to write daemons running in background.
To run it, libgee-0.15 must be installed.
It was made on request, a special case:
"when a usb stick is plugged in, it shall be mounted to /mnt/DMDS-USB/.
Then a script on that stick shall be executed automatically: /mnt/DMDS-USB/Check-usb.sh"
It will read an entry from /proc/.
This is a virtual filesystem containing info about your system.
So you can read the info like from files, but no harddisk activity occurs, as it is in memory, not on a disk.
The program consists of two parts in /usr/local/bin:
detectusbstick
detectusbstickmount
detectusbstick
this is a binary. Written in Genie.
The valac compiler translated it to C, then compiled it.
The source project for the vala-ide is in /usr/local/detectusbstick/.
This binary checks every 2 seconds a change in /proc/diskstats.
It will detect ANY external drive, so not only USBsticks, but also USB-harddrives.
I don't know yet, how to distinguish among different drives, like sticks or harddrives or CF cards.
If a new device beginning with "sd" (example: sdb) is found, it runs:
detectusbstickmount sdb
This is a shellscript, so it can be easily modified for own needs.
It tries to mount /dev/sdb
A Stick also could have more than 1 partition.
So if /dev/sdb fails, it uses /dev/sdb1
Then it runs /mnt/DMDS-USB/Check-usb.sh and pops up a small dialog, that allows to unmount the stick again.
The script contains some error handling, but I cannot guarantee, that all errors are catched.
So please test it carefully.
Hint:
To run it at startup, add it in the end of /root/.xinitrc, before $CURRENTWM is run.
Like this:
--------------------
#v2.11 GuestToo suggested this improvement...
detectusbstick &
which $CURRENTWM && exec $CURRENTWM
--------------------
I attach a pet.
And the source of main.gs, so that it can be quickly looked up here.
compilation:
valac main.gs --pkg=gee-1.0 -o detectusbstick
Mark
It shows well, how great Genie is to write daemons running in background.
To run it, libgee-0.15 must be installed.
It was made on request, a special case:
"when a usb stick is plugged in, it shall be mounted to /mnt/DMDS-USB/.
Then a script on that stick shall be executed automatically: /mnt/DMDS-USB/Check-usb.sh"
It will read an entry from /proc/.
This is a virtual filesystem containing info about your system.
So you can read the info like from files, but no harddisk activity occurs, as it is in memory, not on a disk.
The program consists of two parts in /usr/local/bin:
detectusbstick
detectusbstickmount
detectusbstick
this is a binary. Written in Genie.
The valac compiler translated it to C, then compiled it.
The source project for the vala-ide is in /usr/local/detectusbstick/.
This binary checks every 2 seconds a change in /proc/diskstats.
It will detect ANY external drive, so not only USBsticks, but also USB-harddrives.
I don't know yet, how to distinguish among different drives, like sticks or harddrives or CF cards.
If a new device beginning with "sd" (example: sdb) is found, it runs:
detectusbstickmount sdb
This is a shellscript, so it can be easily modified for own needs.
It tries to mount /dev/sdb
A Stick also could have more than 1 partition.
So if /dev/sdb fails, it uses /dev/sdb1
Then it runs /mnt/DMDS-USB/Check-usb.sh and pops up a small dialog, that allows to unmount the stick again.
The script contains some error handling, but I cannot guarantee, that all errors are catched.
So please test it carefully.
Hint:
To run it at startup, add it in the end of /root/.xinitrc, before $CURRENTWM is run.
Like this:
--------------------
#v2.11 GuestToo suggested this improvement...
detectusbstick &
which $CURRENTWM && exec $CURRENTWM
--------------------
I attach a pet.
And the source of main.gs, so that it can be quickly looked up here.
compilation:
valac main.gs --pkg=gee-1.0 -o detectusbstick
Code: Select all
[indent=2]
//-- run a program in background --
def exec(thecmd : string)
Process.spawn_command_line_async(thecmd)
def read_file_to_list(thefile : string) : list of string
var l = new list of string
var f = FileStream.open(thefile , "r")
var a = new array of char[1024]
while f.gets(a) is not null
var s = (string)a
//--special case: do not return all lines, only the "sdX" portion --
if s.contains(" sd")
var as = new array of string[2]
as = s.split("sd" , 2)
s = "sd" + as[1].substring(0,1)
l.add(s)
//FileStream.close(f)
return l
init
var thefile = "/proc/diskstats"
var lines = new list of string
var oldlines = new list of string
var isnew = false
oldlines = read_file_to_list(thefile)
while true
lines = read_file_to_list(thefile)
for line in lines
isnew = true
for oldline in oldlines
if line is oldline
isnew = false
if isnew is true
print("%s" , line)
exec("detectusbstickmount " + line)
break
oldlines = lines
Thread.usleep(2000000)
- Attachments
-
- detectusbstick01.pet
- (5.22 KiB) Downloaded 546 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
This binary checks every 2 seconds a change in /proc/diskstats.
It will detect ANY external drive, so not only USBsticks, but also USB-harddrives.
I don't know yet, how to distinguish among different drives, like sticks or harddrives or CF cards.
Look at
/sys/block/sda/removable
...it will have '1' if kernel thinks it is removable, ie a flash drive, but will have '0' for a usb hard drive, at least that is how it is with my usb hd.
[url]https://bkhome.org/news/[/url]
Here is an example of a treeview.
The code for vala and for genie is almost identical.
A screenshot is attached in the end.
I used these links to learn about it:
http://valadoc.org/?pkg=gtk+-2.0
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.TreeView
http://valadoc.org/?pkg=gtk+-2.0&elemen ... ViewColumn
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.TreeStore
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.ListStore
http://live.gnome.org/Vala/GTKSample
The vala samples looked pretty commplicated, also they do not deal with treemodel, but with listmodel (so you can show tables).
But both are related, so it helped.
The "final" help to write short code I then found for C#, that has a somewhat similar syntax:
http://mono-project.com/GtkSharp_TreeView_Tutorial
Genie:
Vala:
Mark
The code for vala and for genie is almost identical.
A screenshot is attached in the end.
I used these links to learn about it:
http://valadoc.org/?pkg=gtk+-2.0
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.TreeView
http://valadoc.org/?pkg=gtk+-2.0&elemen ... ViewColumn
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.TreeStore
http://valadoc.org/?pkg=gtk+-2.0&element=Gtk.ListStore
http://live.gnome.org/Vala/GTKSample
The vala samples looked pretty commplicated, also they do not deal with treemodel, but with listmodel (so you can show tables).
But both are related, so it helped.
The "final" help to write short code I then found for C#, that has a somewhat similar syntax:
http://mono-project.com/GtkSharp_TreeView_Tutorial
Genie:
Code: Select all
[indent=4]
uses
Gtk
init
Gtk.init (ref args)
var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (300, 200)
window.destroy += Gtk.main_quit
//window.add (new Gtk.Label ("Hello World!"))
//-- the treeview is the visible container --
var tree = new TreeView ()
tree.set_headers_visible (true);
window.add (tree)
//-- add a column to the treeview --
var column = new TreeViewColumn ()
column.set_title ("column title")
var columncell = new CellRendererText ()
column.pack_start(columncell,true)
column.add_attribute(columncell, "text" , 0)
tree.append_column (column)
//-- the treestore is a model assigned to the treeview , containing the items --
var store1 = new TreeStore (1, typeof (string));
tree.set_model(store1);
//-- add some elements to the tree --
iter : TreeIter
store1.append( out iter,null)
store1.set (iter, 0, "item 1")
iter2 : TreeIter
store1.append( out iter2,iter)
store1.set (iter2, 0, "item 2")
window.show_all ()
Gtk.main ()
Code: Select all
using Gtk;
static int main (string[] args) {
Gtk.init (ref args);
var window = new Window (WindowType.TOPLEVEL);
window.title = "Tree demo";
window.set_default_size (300, 200);
window.position = WindowPosition.CENTER;
window.destroy += Gtk.main_quit;
//-- the treeview is the visible container --
var tree = new TreeView ();
tree.set_headers_visible (true);
window.add (tree);
//-- add a column to the treeview --
var column = new TreeViewColumn ();
column.set_title ("column title");
var columncell = new CellRendererText ();
column.pack_start(columncell,true);
column.add_attribute(columncell, "text" , 0);
tree.append_column (column);
//var store1 = new ListStore (2, typeof (bool), typeof (string));
//-- the treestore is a model assigned to the treeview , containing the items --
var store1 = new TreeStore (1, typeof (string));
tree.set_model(store1);
//-- add some elements to the tree --
TreeIter iter;
store1.append( out iter,null);
store1.set (iter, 0, "item 1");
TreeIter iter2;
store1.append( out iter2,iter);
store1.set (iter2, 0, "item 2");
window.show_all ();
Gtk.main ();
return 0;
}
- Attachments
-
- treeview.jpg
- (6.54 KiB) Downloaded 1516 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
Here is the Genie treeview slightly extended.
It now has event handlers, so the program prints information about the selected/collapsed/expanded nodes.
Mark
It now has event handlers, so the program prints information about the selected/collapsed/expanded nodes.
Code: Select all
[indent=4]
uses
Gtk
//-- global variables, so we can use them in the eventhandlers --
tree : TreeView
store1 : TreeStore
//-- action: a line in the tree was clicked --
def row_click()
var selection = tree.get_selection()
iter : TreeIter
var rows = selection.get_selected_rows(null)
if rows.length() is 0
return
selection.get_selected(null, out iter)
var ret = ""
tree.model.get( iter ,0 ,out ret)
print ("selected: %s" , ret)
//-- action: a line in the tree was expanded --
def row_expanded(iter : TreeIter , path : TreePath)
var ret = ""
store1.get(iter ,0 ,out ret)
print ("expanded: %s" , ret)
print ("path: %s" , path.to_string())
//-- action: a line in the tree was collapsed --
def row_collapsed(iter : TreeIter , path : TreePath)
var ret = ""
store1.get(iter ,0 ,out ret)
print ("collapsed: %s" , ret)
print ("path: %s" , path.to_string())
//-- main program --
init
Gtk.init (ref args)
var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (300, 200)
window.destroy += Gtk.main_quit
//window.add (new Gtk.Label ("Hello World!"))
//-- the treeview is the visible container --
tree = new TreeView ()
tree.set_headers_visible (true);
window.add (tree)
//-- set how many lines can be selected --
var selection = tree.get_selection()
selection.set_mode((SelectionMode)1)
//0: GTK_SELECTION_NONE
//1: GTK_SELECTION_SINGLE
//2: GTK_SELECTION_BROWSE
//3: GTK_SELECTION_MULTIPLE
//-- add a column to the treeview --
var column = new TreeViewColumn ()
column.set_title ("column title")
var columncell = new CellRendererText ()
column.pack_start(columncell,true)
column.add_attribute(columncell, "text" , 0)
tree.append_column (column)
//-- the treestore is a model assigned to the treeview , containing the items --
store1 = new TreeStore (1, typeof (string));
tree.set_model(store1);
//-- add some elements to the tree --
iter : TreeIter
store1.append( out iter,null)
store1.set (iter, 0, "item 1")
iter2 : TreeIter
store1.append( out iter2,iter)
store1.set (iter2, 0, "item 2")
iter3 : TreeIter
store1.append( out iter3,iter2)
store1.set (iter3, 0, "item 3")
//-- assign the eventhandlers for the tree --
tree.row_expanded += row_expanded
tree.row_collapsed += row_collapsed
Signal.connect_after (tree, "button_release_event", row_click, null);
window.show_all ()
Gtk.main ()
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
And here is a more complex solution.
It consists of two sourcefiles.
tree.gs is a class to set up a treeview and add items.
This allows to keep the main.gs shorter.
This class supports pictures.
And as it is a class, you easily can define more than one tree.
As you can see on the screenshot, you also easily can simulate a "Clist" like this, thats to say a picturelist that is not showing a tree, but only some pictures with text one beneath the other.
Like the two elements with the text-icons.
Here is an extract of the usage:
Mark
It consists of two sourcefiles.
tree.gs is a class to set up a treeview and add items.
This allows to keep the main.gs shorter.
This class supports pictures.
And as it is a class, you easily can define more than one tree.
As you can see on the screenshot, you also easily can simulate a "Clist" like this, thats to say a picturelist that is not showing a tree, but only some pictures with text one beneath the other.
Like the two elements with the text-icons.
Here is an extract of the usage:
Code: Select all
//-- action: a line in tree1 was clicked --
def tree1_row_click()
var ret = treeclass1.tree_click(mytree1)
print ("selected is: %s" , ret)
//-- main program --
init
Gtk.init (ref args)
var window = new Gtk.Window (Gtk.WindowType.TOPLEVEL)
window.set_default_size (300, 200)
window.destroy += Gtk.main_quit
var hbox = new Gtk.HBox(false , 1)
hbox.border_width = 10
hbox.spacing = 10
window.add (hbox)
//-- create a new tree --
treeclass1 = new treeclass()
mytree1 = treeclass1.treeview()
hbox.pack_start (mytree1, true, true, 0);
var item_A1 = treeclass1.add_root_item("test A1" )
var item_A2 = treeclass1.add_item("test A2" , item_A1)
treeclass1.set_image("text.png")
var item_A3 = treeclass1.add_item("test A3" , item_A2)
var item_A4 = treeclass1.add_item("test A4" , item_A2)
treeclass1.tree.row_expanded += tree1_row_expanded
treeclass1.tree.row_collapsed += tree1_row_collapsed
Signal.connect_after (treeclass1.tree, "button_release_event", tree1_row_click, null);
Mark
- Attachments
-
- treeviewcomplex.jpg
- (16.98 KiB) Downloaded 1432 times
-
- TreeView-Genie-Complex.tar.gz
- (27.17 KiB) Downloaded 588 times
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
- Lobster
- Official Crustacean
- Posts: 15522
- Joined: Wed 04 May 2005, 06:06
- Location: Paradox Realm
- Contact:
Whist MU astounds us with real programs
I am attempting to use Valide in Jaunty Pup with the devxx
First of all Valide is now more stable - hooray
I had to go back to basics
Valide seems to be changing
tabs to two indents (this is the default mode, which I will stick with
BUT can be changed in Edit / Preferences from the latest Valide)
Valide is much improved
So I place this on top of programs
and made sure I finished with a tab on a blank line
OK that works
. . . to be continued . . .
I am attempting to use Valide in Jaunty Pup with the devxx
First of all Valide is now more stable - hooray
I had to go back to basics
Valide seems to be changing
tabs to two indents (this is the default mode, which I will stick with
BUT can be changed in Edit / Preferences from the latest Valide)
Valide is much improved
So I place this on top of programs
Code: Select all
[indent=2]
Code: Select all
[indent=2]
init
// return a random value from 1 to 9
a:int
a = GLib.Random.int_range(1,10)
print("%d" , a)
. . . to be continued . . .
I attach a next step.
This is a tree, that displays the folders on your computer, and the files in them.
This is far from being finished, but basically works.
I just upload it for people, who might need to look up the one or other command in the code.
The filebrowsing is not yet placed in the treeview class, so the main.gs looks prettty complex, you also could say "messy".
So do not use it as a template for an own program yet.
The trees now are attached to a project.glade, that also includes the 3 buttons.
Mark
This is a tree, that displays the folders on your computer, and the files in them.
This is far from being finished, but basically works.
I just upload it for people, who might need to look up the one or other command in the code.
The filebrowsing is not yet placed in the treeview class, so the main.gs looks prettty complex, you also could say "messy".
So do not use it as a template for an own program yet.
The trees now are attached to a project.glade, that also includes the 3 buttons.
Mark
- Attachments
-
- filebrowser01.jpg
- (39.26 KiB) Downloaded 1337 times
Last edited by MU on Sun 03 May 2009, 11:30, edited 4 times in total.
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]
I have not cleaned up the classes yet, but it was challenging, to add some lines, that turn the filebrowser into a usable application.
So now it is a small pictureviewer
http://www.murga-linux.com/puppy/viewto ... 381#301381
I updated the source to v0.3.
Mark
So now it is a small pictureviewer
http://www.murga-linux.com/puppy/viewto ... 381#301381
I updated the source to v0.3.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]