might be a corrupted download.
Please try this mirror:
http://puppyfiles.ca/dotpupsde/puppy3/d ... ic-003.pup
Mark
GtkBasic 003e - small Basic interpreter/IDE - 3300 functions
Mark,
Using the latest gtkbasic, downloaded last week, I encounter a glitch with clists. The program is a menu editor that uses two clists and reads the icons that match the menu and applications from the normal locations in puppy 4.0. I can drag & drop from one clist to the other ok but if I drag a file from rox the program crashes hard with [Internal error] Memory error (SIGSEGV). It seems to be related to the type of image used for the icons. To verify it I modified the demo that comes with gtkbasic so it uses a png instead of the xpm images and it crashed in the same way. That png was created with mtpaint. When I used another png selected at random it did not crash. Very strange. I seem to recall that the latest gtkbasic was modified for drag and drop with xfe. Could this glitch be related to that?
I would be interested in any suggested fixes that I could try here.
Vern
Using the latest gtkbasic, downloaded last week, I encounter a glitch with clists. The program is a menu editor that uses two clists and reads the icons that match the menu and applications from the normal locations in puppy 4.0. I can drag & drop from one clist to the other ok but if I drag a file from rox the program crashes hard with [Internal error] Memory error (SIGSEGV). It seems to be related to the type of image used for the icons. To verify it I modified the demo that comes with gtkbasic so it uses a png instead of the xpm images and it crashed in the same way. That png was created with mtpaint. When I used another png selected at random it did not crash. Very strange. I seem to recall that the latest gtkbasic was modified for drag and drop with xfe. Could this glitch be related to that?
I would be interested in any suggested fixes that I could try here.
Vern
Updated to 003d, compiled with less dependencies, tested in Puppy 4, Puppy 3, Puppy 2.12 (Muppy007), Muppy0084beta2.
You also need Puppybasic 2.6, as it includes an important function-library:
http://murga-linux.com/puppy/viewtopic.php?t=11090
I do not bundle both, as Puppybasic uses less memory, so it should be used for small scripts instead of Gtkbasic.
Clists now can return multiple selections:
alist = gtk_get_list_selections("mylist1")
this returns a list with the numbers of the selected rows.
There is no example available yet, it will come in the next update of the GtkBasic-Filer:
http://www.murga-linux.com/puppy/viewtopic.php?t=32575
Mark
You also need Puppybasic 2.6, as it includes an important function-library:
http://murga-linux.com/puppy/viewtopic.php?t=11090
I do not bundle both, as Puppybasic uses less memory, so it should be used for small scripts instead of Gtkbasic.
Clists now can return multiple selections:
alist = gtk_get_list_selections("mylist1")
this returns a list with the numbers of the selected rows.
There is no example available yet, it will come in the next update of the GtkBasic-Filer:
http://www.murga-linux.com/puppy/viewtopic.php?t=32575
Mark
Last edited by MU on Sun 31 Aug 2008, 13:23, edited 1 time in total.
upgraded to version 003e
Changes:
- fixed handling of clists with multiple selections
- fixed errors with drag'n'drop in clists
- keypresses now are sent to the mainloop
(see the updated Textview demo for examplecode)
- xwin_readdir( thefolder , hidden )
thefolder isa fldername
hidden is 0 or 1
Example:
this will print lines like:
size
type (1=file, 2=dir, 3=char device, 4=blockdevice, 5=fifo, 6= broken link)
link target for links
link references
date time
uid
gid
user
group
permissions
It is pretty fast
Mark
Changes:
- fixed handling of clists with multiple selections
- fixed errors with drag'n'drop in clists
- keypresses now are sent to the mainloop
(see the updated Textview demo for examplecode)
- xwin_readdir( thefolder , hidden )
thefolder isa fldername
hidden is 0 or 1
Example:
Code: Select all
#!/usr/bin/gtkbasic003
f="/root"
'f="/usr/lib"
a,b=xwin_readdir(f , "1")
for n=0 to count(a)-1
print a[n]
print b[n]
next
a,b=xwin_readdir(f , "0")
for n=0 to count(a)-1
print a[n]
print b[n]
next
Code: Select all
sphere.xpm
1072 6 /usr/local/GTB-Filer/resource/sphere.xpm 1 17.08.2008 01:49 0 0 root root rw-r--r--
spot
1024 2 3 18.08.2008 06:34 502 502 spot spot rwxr-xr-x
test
1024 2 5 30.08.2008 17:43 0 0 root root rwxr-xr-x
type (1=file, 2=dir, 3=char device, 4=blockdevice, 5=fifo, 6= broken link)
link target for links
link references
date time
uid
gid
user
group
permissions
It is pretty fast
Mark
Updated 003e
Added this function:
gtk_clist_define_cols(2)
Use any number you like.
Run it before:
gtk_createobject("GtkBasicList" , "mylist1", "window1" , "scrolledwindow1")
Now that list has more than one title.
I realized this as optional function, to keep old code working.
You now should be able to use the standard functions, e.g. to set column titles.
If not, let me know.
I'm away from mnday to wednesday, so have no time to write an extended demo.
To find out, how you can get the result from multiple selected lines, plese examine Muppy-Filer 0.2:
http://murga-linux.com/puppy/viewtopic.php?t=32575
Mark
Added this function:
gtk_clist_define_cols(2)
Use any number you like.
Run it before:
gtk_createobject("GtkBasicList" , "mylist1", "window1" , "scrolledwindow1")
Now that list has more than one title.
I realized this as optional function, to keep old code working.
You now should be able to use the standard functions, e.g. to set column titles.
If not, let me know.
I'm away from mnday to wednesday, so have no time to write an extended demo.
To find out, how you can get the result from multiple selected lines, plese examine Muppy-Filer 0.2:
http://murga-linux.com/puppy/viewtopic.php?t=32575
Mark
Mark, I'm just playing in puppy 4.1alpha7 and I have a problem with the multifilechooser
It crashes when I hit the Apply button.
I originally noticed this because GTB-StructrEd does not load files.
I have installed puppybasic-2.6.
Code: Select all
# ./GBdialog-multifilechooser 'open file' '/usr/local/Gtkbasic-003/dialog-multifilechooser' '*' '1' '1'
(gtkbasic003:7724): GLib-GObject-WARNING **: gsignal.c:1669: signal `event' is invalid for instance `0x8d8eee0'
[Internal error]
Memory error (SIGSEGV)
gtk() in file "GBdialog-multifilechooser", line 115:
> mylist = gtk("gtk_file_chooser_get_filenames" , chooser[mode] , 0,0,0,0,0)
#
I originally noticed this because GTB-StructrEd does not load files.
I have installed puppybasic-2.6.