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 21 Oct 2014, 22:04
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
gtkbasic-0.0.2
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 3 of 6 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 23 May 2007, 18:21    Post_subject: A mouse bug with gtkbasic002?
Sub_title: Double entry
 

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.
Back to top
View user's profile Send_private_message 
MU


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

PostPosted: Wed 23 May 2007, 18:37    Post_subject:  

This is a bug in JWM I think.
Look at calc.pb

You see:
Code:
    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:
    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" Wink

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

Mark
Back to top
View user's profile Send_private_message Visit_website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 23 May 2007, 18:49    Post_subject: Thanks for clarification!
Sub_title: Calc now works fine in IceWM
 

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
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Thu 24 May 2007, 04:13    Post_subject:  

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


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

PostPosted: Thu 24 May 2007, 04:17    Post_subject:  

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 Wink

Mark
Back to top
View user's profile Send_private_message Visit_website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 24 May 2007, 07:18    Post_subject: Calc variation
Sub_title: Learning gtkbasic
 

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
calc2.zip
Description 
zip

 Download 
Filename  calc2.zip 
Filesize  887 Bytes 
Downloaded  553 Time(s) 
Back to top
View user's profile Send_private_message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Thu 24 May 2007, 14:52    Post_subject:  

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!
Back to top
View user's profile Send_private_message 
MU


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

PostPosted: Thu 07 Jun 2007, 00:48    Post_subject:  

I updated the archives.

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

Code:
    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
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


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

PostPosted: Thu 07 Jun 2007, 12:53    Post_subject:  

Smile 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

Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
MU


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

PostPosted: Thu 07 Jun 2007, 13:10    Post_subject:  

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 Smile
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 Razz Very Happy

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/glib/glib-Threads.html#GStaticMutex
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:
    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
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


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

PostPosted: Thu 07 Jun 2007, 14:39    Post_subject:  

MU wrote:

Logo? Ok, I'm curious Smile
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?


OK I am on it . . .

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
MU


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

PostPosted: Thu 07 Jun 2007, 14:55    Post_subject:  

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 Smile
Mark
GtkBasic.png
 Description   
 Filesize   3.28 KB
 Viewed   811 Time(s)

GtkBasic.png

Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


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

PostPosted: Thu 07 Jun 2007, 15:34    Post_subject:  


_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
MU


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

PostPosted: Thu 07 Jun 2007, 15:45    Post_subject:  

hey, looks great Smile

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 Very Happy
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
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


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

PostPosted: Thu 07 Jun 2007, 17:39    Post_subject:  

Glad you like it - modify any way that suits Smile
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.

Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 3 of 6 Posts_count   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0924s ][ Queries: 13 (0.0112s) ][ GZIP on ]