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 Sat 19 Apr 2014, 22:52
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
wxBasicscript - script language for Xdialog
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 4 [51 Posts]   Goto page: Previous 1, 2, 3, 4
Author Message
JohnMurga
Site Admin


Joined: 04 May 2005
Posts: 586
Location: Far to the east

PostPosted: Thu 22 Sep 2005, 10:23    Post subject:  

In that example you seem to be calling xdialog as a command as I would from a shell script ...

What if the wxBasic program is doing what you want to report progress on, how do you do this without having to run the function as another process piped to xdialog ?

Also, on the GtkDialog homepage there is a REALLY cool example of doing event driven BASH ... Would it be possible to do even driven wxBasic ?

Cheers
JohnM
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: Thu 22 Sep 2005, 10:36    Post subject:  

JohnMurga wrote:

What if the wxBasic program is doing what you want to report progress on, how do you do this without having to run the function as another process piped to xdialog ?


I think this will not work, you would have to do this with the "big" wxBasic.
It allows you to run subs or functions parrallel, with help of wxTimer().
An example can be found here:
http://wxbasic.sourceforge.net/phpBB2/viewtopic.php?t=769

The Backup-program displayes the procentual size of a tempfile in a wxGauge, while a file is zipped.

The only way to do it with wxbs would be something like this (this does not work,dont't know how to use while in shellscripts, just as an idea):

Code:

GAUGE="("&
"while [ ! \"`cat gauge.tmp`\" = \"20\" ];do;done; echo \"20\";"&
"while [ ! \"`cat gauge.tmp`\" = \"40\" ];do;done; echo \"40\";"&
")"

xin_exec( GAUGE & "|Xdialog ...  &" )
mysub1()
mysub2()
end

sub1()
  dosomething()
  writestringtofile("gauge.tmp" , "20")
endsub

sub2()
  dosomethingelse()
  writestringtofile("gauge.tmp" , "40")
endsub


JohnMurga wrote:

Also, on the GtkDialog homepage there is a REALLY cool example of doing event driven BASH ... Would it be possible to do even driven wxBasic ?


Do you mean updating the RPM-lists?
The Dotpup-downloader uses Gtkdialog embedded in wxBasicscript, I will write an introduction to use Gtkdialog to create such programs this weekend.
Meanwhile you might to have a look at the source, added some comments, but it is not well documentated yet.

http://www.murga.org/%7Epuppy/viewtopic.php?t=2144

Mark
Back to top
View user's profile Send private message Visit poster's website 
JohnMurga
Site Admin


Joined: 04 May 2005
Posts: 586
Location: Far to the east

PostPosted: Thu 22 Sep 2005, 12:22    Post subject:  

MU wrote:
Do you mean updating the RPM-lists?
The Dotpup-downloader uses Gtkdialog embedded in wxBasicscript, I will write an introduction to use Gtkdialog to create such programs this weekend.
Meanwhile you might to have a look at the source, added some comments, but it is not well documentated yet.

http://www.murga.org/%7Epuppy/viewtopic.php?t=2144

Mark


Yeah, in the RPM-lists program it calls functions inside a bash script.

Thanks, I did look at the source. It looked like it invoked the sub-routines as scripts in themselves, which is cool ... But I was wondering if it would be possible to call functions in the same way as with the Bash example.

Cheers
JohnM
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: Thu 22 Sep 2005, 12:45    Post subject:  

No, I think this is not possible.

In fact wxbs/Xdialog is not a perfect combination.

wxbs is just a "wrapper", that "hides" shell-commands by putting them in functions in basefunctions.inc.

basefunctions.inc itself creates shell-commands to run Xdialog/Gtkdialog.

But wxbs is missing the functionality of opening a process connected via a pipe to other programs.
I wish I had such functions, but I am not fit enough in C to add them to the interpreter yet.
Maybe in half a year or so.

I'm sorry Confused

Greets, Mark
Back to top
View user's profile Send private message Visit poster's website 
JohnMurga
Site Admin


Joined: 04 May 2005
Posts: 586
Location: Far to the east

PostPosted: Thu 22 Sep 2005, 12:54    Post subject:  

MU wrote:
But wxbs is missing the functionality of opening a process connected via a pipe to other programs.
I wish I had such functions, but I am not fit enough in C to add them to the interpreter yet.
Maybe in half a year or so.

I'm sorry Confused


No problem !

I was trying to discover the limits of what can be done currently ... What you are are doing is still really cool Wink

Cheers
JohnM
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: Thu 22 Sep 2005, 13:46    Post subject:  

Yes, it is not really a problem.
wxBasicscript is intented to be mainly for Beginners.
(Although the string-functions are nice for advanced, too).

If you are experienced and want to use some advanced techniques, you might try the "big" wxBasic, or write the applications completely using shellscripts Smile

Mark
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 4 of 4 [51 Posts]   Goto page: Previous 1, 2, 3, 4
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.0856s ][ Queries: 13 (0.0386s) ][ GZIP on ]