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 Tue 16 Sep 2014, 07:43
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
GtkBasic 003e - small Basic interpreter/IDE - 3300 functions
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [28 Posts]   Goto page: Previous 1, 2
Author Message
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sat 05 Jan 2008, 00:38    Post subject:  

GtkBasic currently supports Drag'n'Drop for Clists (lists that can display pictures and texts).
I have written some custom functions to simplify this, there is a demo included.
I did not try the drag'n'drop functionality of the native Gtk-functions that GtkBasic supports now.
So I cannot tell, if they are wrapped correctly or not.
However with the Clists you can build very comfortable Drag'n'Drop programs.

GtkBasic will not be in Puppy until we program utilities that make it a "must" Wink
Barry has pointed out, that he wants to keep Dingo (Puppy4) as small as possible, and so just leaves in GtkDialog and Xdialog.

So GtkBasic must be installed in addition, but it certainly soon will be bundled with addons like ezpup.

The size is reasonable: 200 k compressed with upx, or 930 k uncompressed.
Plus some kb for examples or utilities like the file-selection dialog, that is written in GtkBasic.
It just depends on X, Gtk2, and libglade.
Those are usually already in Puppy.

Mark
Back to top
View user's profile Send private message Visit poster's website 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Sat 05 Jan 2008, 12:27    Post subject:  

is it possible to use gtkbasic witthout Ezpup?
i failed to open dotpups .de with wideband limit error
what does it mean?

_________________
skype: desafimager
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sat 05 Jan 2008, 17:08    Post subject:  

yes, GtkBasic is a standalone-program.
Dotpups.de is down today, here is a mirror:
http://www.puppyfiles.ca/dotpupsde/puppy3/dotpups/Programming/GtkBasic003/

Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 18 Feb 2008, 16:31    Post subject:  

I updated the Dotpup for Puppy 3 (which was reported to work in Puppy2, too).
And uploaded the sourcecode, too.

New:
Objectdestruction
In the past, the function gtk_destroyobject() did not work.
I now rewrote the internal reference-handling of the objects.

GtkBasic allows to handle 1000 Gtk-widgets at once.
If you need more, you first must destroy older ones, or you application crashes.

I could add support for more, but that increases memory-usage.
Tell me, when you need more.

Exclamation IMPORTANT: Exclamation
If you have an old application, that crashes now, please tell me.
I then will repackage it.
It will be sufficient, to remove lines using
gtk_destroyobject()
I had added that for tests in the past, but it had no function.
Now this could crash your app, if those objects still are needed.


For debugging I added:
gtk_dumpobjects()

This shows a list of all objects you created, and the length of the internal reference-list.
So you can see, if you properly destroyed objects.



I also added some new functions to handle mouseclicks better.

gtk_createobject("singleclickbutton","buttontest",0,0)
or:
gtk_createobject("singleclickbutton_with_label","buttontest","Hello",0)
or
gtk_createobject("singleclickeventbox","buttontest",0,0)

This creates a button, where signalhandling is not added to libglade.
You can assign a new signaldetection like this:
gtk_singleclick("buttontest" )

When this button now is clicked, you can detect this in the mainloop.
To be able to avoid confusion with the standard (libglade) eventmessages, this function returns the widgetname modifed.
The returnvalue for the widget now has a leading "single-".

So to detect it, you would write:
if widget = "single-buttontest" then

This application makes use of it:
http://murga-linux.com/puppy/viewtopic.php?p=174389#174389


Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
mrkcee

Joined: 22 Jan 2008
Posts: 19

PostPosted: Mon 25 Feb 2008, 02:06    Post subject:  

Whenever I run the pup file, I always says that I don't have enough disk space for it. But I have 200MB+ free space. Any ideas?
_________________
Currently using: Puppy Linux 3.00 + Fluxbox
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 25 Feb 2008, 07:36    Post subject:  

might be a corrupted download.
Please try this mirror:

http://puppyfiles.ca/dotpupsde/puppy3/dotpups/Programming/GtkBasic003/Gtkbasic-003.pup

Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
2byte

Joined: 09 Oct 2006
Posts: 357

PostPosted: Thu 29 May 2008, 09:47    Post subject:  

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
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Mon 18 Aug 2008, 23:59    Post subject:  

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

_________________
my recommended links

Last edited by MU on Sun 31 Aug 2008, 09:23; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 31 Aug 2008, 02:10    Post subject:  

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:


Code:
#!/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


this will print lines like:
Code:
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


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 Smile

Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 31 Aug 2008, 03:31    Post subject:  

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

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Sun 31 Aug 2008, 08:33    Post subject:  

I discovered and fixed a bug in GtkBasic 003e.

The new keyevents could override buttonpresses from the mouse.

Please download again.

Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
HairyWill


Joined: 26 May 2006
Posts: 2949
Location: Southampton, UK

PostPosted: Mon 08 Sep 2008, 18:27    Post subject:  

Mark, I'm just playing in puppy 4.1alpha7 and I have a problem with the multifilechooser
Code:
# ./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)

#

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.

_________________
Will
contribute: community website, screenshots, puplets, wiki, rss
Back to top
View user's profile Send private message 
MU


Joined: 24 Aug 2005
Posts: 13642
Location: Karlsruhe, Germany

PostPosted: Tue 09 Sep 2008, 05:05    Post subject:  

I updated GtkBasic 003e.

It fixes a wrong variabledeclaration, that caused the filechooser to crash in Puppy4.

Thanks to Hairywill for his detailed report!
Mark

_________________
my recommended links
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 2 of 2 [28 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.0910s ][ Queries: 13 (0.0099s) ][ GZIP on ]