Page 2 of 4

A mouse bug with gtkbasic002?

Posted: Wed 23 May 2007, 22:21
by vovchik
Dear Mark,

I don't know whether other users can replicate this "feature", but I get "11" entered into the demo calc program each time I press, ofr example, a single "1". Upon a mouse click, a single number appears in the input field. When I move the mouse away, and the number is still highlighted, a repeat of the original input takes place. I don't know whether that is a bug in the calc program itself (calc.pb), which i've not examined yet, or a general problem with mouse button handling in gtkbasic002.

Has anybody else experienced that same problem?

With kind regards,
Vovchik

PS. I just downloaded and tested the new version and the bug still seems to be there, if, indeed, it is in gtkbasic002 and not in calc.pb.

Posted: Wed 23 May 2007, 22:37
by MU
This is a bug in JWM I think.
Look at calc.pb

You see:

Code: Select all

    if event = "GDK_BUTTON_RELEASE" or event = "GDK_BUTTON_PRESS" then
GDK_BUTTON_PRESS is a good signal, but captured by JWM.
With Icewm it works fine, if you have a different windowmanager than JWM, replace the line like this:

Code: Select all

    if event = "GDK_BUTTON_PRESS" then
Now it works correct in Icewm, but not at all in JWM.

This issue currently is unresolved.
If I find time, I will write Joe Wing (JWM) to see, if he has an idea.
I also may try to modify the internal signal-handling.
If a "GDK_BUTTON_RELEASE" is detected, it might be catched, and instead a "GDK_BUTTON_PRESS" might be sent. But I'm not shure, if my knowledge is good enough to do that.,
I will try it next week, when I hopefully have more free evenings (no more dentist or Server-room upgrade at work or journey to Hamburg).
On wednesday I'll finally get 9 new teeth in my bottom jaw, at moment I have some made of plastic. Feel a bit like "Mr. Data" ;-)

This button-issue has high priority, as it is essential.

Mark

Thanks for clarification!

Posted: Wed 23 May 2007, 22:49
by vovchik
Dear Mark,

Thanks for the code snippet. Everything now works as it should in calc.pb under IceWM, which is my standard WM. JWM must have a bug related to mouse signal handling.

MfG,
Vovchik

Posted: Thu 24 May 2007, 08:13
by sunburnt
Hey Mark; I installed GTKbasic-002 in Puppy216 & I get this error with the filechooser demo:
Argument count mismatch!

It installed with no errors... was there something I missed? (probably)
I haven't followed this thread closely... Terry

Posted: Thu 24 May 2007, 08:17
by MU
The error is intended, it is an error-dialog I added.
After this message, you should see several fileselectiondialogs.
The error-message is just a custom dialog to show, that the fileselector checks, if it is called correctly.

Maybe a bit confusing, I should add a message that explains that ;)

Mark

Calc variation

Posted: Thu 24 May 2007, 11:18
by vovchik
Dear Mark,

I took the liberty of restructuring the calc program so that I could myself get a better handle on gtkbasic. I am attaching it here as it might be useful for others on the forum. I also added a "divison by zero" check without which the program would bomb if "0" were the divisor. To run it, just click on it in rox (once it has been made executable).

With kind regards,
Vovchik

Posted: Thu 24 May 2007, 18:52
by sunburnt
Your right as usual, the file browser ran properly.

I'm fixing a few of my posted apps., but I'll let you know how I do with it.
I already have a few ideas for guis to try making with it... Terry

Good work vovchik, we need more coders to fill in the gaps!

Posted: Thu 07 Jun 2007, 04:48
by MU
I updated the archives.

The buttons now seem to work in JWM and Icewm, using

Code: Select all

    if event = "GDK_BUTTON_RELEASE"  then
I modified this event, after it is detected, a gtk_widget_activate(GTK_WIDGET(widget) ); is executed internally.
This forces the window to continue without that you explicitly have to move the mouse.

The IDE-prototype still has the problem with xlib-sync errors, if you open more than one window simultaneously in a program.
I googled some more, again found hints about the Thread-handling of Gtk and Xlib. This will not be easy to solve.

Vovchick: thanks for your calc-rewrite.
Wanted to add it to the updated archive, but then found a bug in it inherited from mine. I just had time to update my code, will add yours to the next update. (Bug was: you just could type 1 digit of a number after you chose +-/*).

Mark

Posted: Thu 07 Jun 2007, 16:53
by Lobster
:) Moin Mark - actually afterMoin - sort of Guten Tag

anyway finally had a look at your innovations
calc worked OK - looking foward to the IDE (if that is possible)

The name "TuxBasic" is available - also you intend it to be a major component of Muppy? So MuppyBasic . . .

If you want to use PuppyBasic2 or GtkBasic as the name or whatever (let me know) and I can create a logo and wiki page and get some support going?

In fact I might create a page from the developing Prism Page at tmxxine
http://tmxxine.com/Wikka/wikka.php?wakka=RainbowPrism

:)

Posted: Thu 07 Jun 2007, 17:10
by MU
I think there once was a Gtkbasic for Gtk1, but I found not much using google.
So I think it might be ok to stay with GtkBasic.

Logo? Ok, I'm curious :)
The current one is a mix of the wxWidgets-logo (mondrian, a painter , who painted such yellow white blue red paintings), and the Gtk-logo.
I used the wxLogo because I like it, and Gtkbasic derives of wxBasic.
Though it has no more "wx" left in it at all.

I updated the archives.
I now finally could fix those xlib-sync-errors :P :D

It was done by locking the functions that access Gtk-widgets, so that no other function can disturb our actions.
This is done using a "mutex", see:
http://developer.gnome.org/doc/API/2.0/ ... taticMutex
Was a bit hefty to finally find this solution, but the code itself is pretty simple.
So if someone reads this via google, e.g. if he looks for thread-errors in Python, he might have a look at the sourcecode:

Code: Select all

    static int current_number = 0;
    static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
    g_static_mutex_lock (&mutex);

	GSList* thefilenames = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (obj));

	g_static_mutex_unlock (&mutex);

 
Here I surrounded the call of a Gtk-function with this mutex-code, what prevents the xlib-sync errors.

Mark

Posted: Thu 07 Jun 2007, 18:39
by Lobster
MU wrote: Logo? Ok, I'm curious :)
The current one is a mix of the wxWidgets-logo (mondrian, a painter , who painted such yellow white blue red paintings), and the Gtk-logo.
I used the wxLogo because I like it, and Gtkbasic derives of wxBasic.
Though it has no more "wx" left in it at all.
I am familiar with Mondrian - they have some of his paintings in the Tate Gallery London and Apple had a special edition computer with his design (I think it was Apple)

However I am not familiar with any existing logo?

you mean this?
Image

OK I am on it . . .

Posted: Thu 07 Jun 2007, 18:55
by MU
There is an icon included in the dotpup, the larger original pictures are in the source.tgz (in /media).
I attach the current icon.
It was however just a quick solution to have something that fits more or less, so other suggestions are welcome :)
Mark

Posted: Thu 07 Jun 2007, 19:34
by Lobster
Image

Posted: Thu 07 Jun 2007, 19:45
by MU
hey, looks great :-)

I would reduce the bottom-part, so that the whole picture becomes a square (for the Desktop-Icon).

I think I will add it to the next update, good work, Lob :D
You did that with Xara?

Btw. I think of leaving germany, as I currently just earn 10 Euro/hour.
In London I found via web jobs for Perl-programmers, where I could get 3-6 times more.
So I'll start writing an english CV soon.

Would be nice to drink a coffee together after work, right?

Mark

Posted: Thu 07 Jun 2007, 21:39
by Lobster
Glad you like it - modify any way that suits :)
Yes done in Xara

London is great but expensive to live in
Coffee would be great - you can get great coffee

BUT . . . years ago I was travelling by National Express coach from London, with my Spanish girlfriend and the hostess came along and asked if we wanted coffee . . . I declined and advised NOT to order 'coffee' - but she ordered . . .

"You have not drunk your coffee?" enquired the hostess collecting cups and litter
"That is not coffee!" she was informed with suitable disdain.

:)

Posted: Sat 09 Jun 2007, 13:03
by MU
Ok, I can ask my mum to send me instant coffee from germany ;-)

I updated:
http://dotpups.de/dotpups/Programming/Gtkbasic-002.pup

It now includes a *simple* IDE.
It might be unstable, I encountered Xlib-errors again, but more seldom now.
I however decided to release it, as it already might help to get started.
The IDE itself does not "save" files, it just uses leafpad and Glade.
So it is not so worse, if it should crash.

You currently can create new projects (a button or a calculator), run them, modify them, dotpup them.

Not much more yet, but I think for someone completely new it is hepfull to have everything available from one interface.

Here is a screenshot:

Image

Limitations:
occasional crashes when the "new"-dialog opens.
The Textview crashes often, if the text you load contains ":".
For this reason I wrote a function as a workaround, that replaces ":" with "-->".
Very dirty, just to avoid crashes, until I found out what the heck is going on here.

Please see it still in Prototype-stadium, but now at least somewhat usable.
You can use xkill to delete crashed windows:
http://www.murga-linux.com/puppy/viewto ... ach&id=217

Mark

Posted: Sun 10 Jun 2007, 05:06
by MU
I made a very slight change to the button-release code, what might fix the xlib-errors.
At least no crash yet in my tests, but I must test more to verify it.
Updated the dotpup.
Mark

Posted: Sun 10 Jun 2007, 06:00
by MU
updated the dotpup.
I think I could workaround the issue with ":" in the textview.

You can open the IDE project in the IDE itself, to examine it.

Mark

Posted: Sun 10 Jun 2007, 06:24
by MU
made an error while packaging, uploaded again.
Mark

Posted: Sun 10 Jun 2007, 09:09
by DavidBell
Does the .pup contain everything needed to try, or does it need some extras? I would like to try it in the next couple of weeks.

TIA DB