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 Mon 22 Oct 2018, 16:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Gtkwialog project
Post new topic   Reply to topic View previous topic :: View next topic
Page 6 of 7 [96 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Wed 06 Jun 2018, 21:32    Post subject:  

@aaaaa: the code is still being tested to see if useful and likely to be adopted.
...
But yes, your getenv preference would be a nice additional option so that one could chose the preferred method to activate the new modes - easily done and I'll bear that in mind. I used almost identical getenv code in my very old 'wiak' program of eight or more years ago as it happens.

The following by the way is pretty much the simple method being used to select the new modes anyway, albeit for commandline args rather than a getenv result:

aaaaa wrote:

Code:

#include <stdlib.h>

if (getenv("GTKWIALOG")) {
 GTKWIALOG=1;
}




Just two simple flags (option_blocking or option_nonblocking) used by an if statement to control the flow logic. Pretty much impossible to get wrong - safe as pie...

wiak

Last edited by wiak on Mon 09 Jul 2018, 02:36; edited 2 times in total
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Wed 06 Jun 2018, 23:50    Post subject:  

I now note that Thunor knew about the bash issue with gtkdialog running /bin/sh -c via system() call:

http://murga-linux.com/puppy/viewtopic.php?p=668694#668694

He correctly stated that one way round was to not use bashisms (but that is restrictive since bash was specially designed as a more powerful interactive and programmer's shell; a 'better' more sophisticated programming language effectively - shame to have to ignore it when programming shell apps, whilst forcing bash, in Puppy and the Dogs, as an inefficient, slow, system shell - but bash certainly fast enough at human level for simple app/util writing).

However, Thunor got it wrong thinking/suggesting in his linked post above that another solution was to use bash -c before actions in gtkdialog - his suggestion simply doesn't work for legacy gtkdialog because, as I explained, the forced /bin/sh -c invocation strips the bash environment and the bash exported function calls are lost.

Hence my gtkwialog creation/fork, which does behave the way Thunor imagined legacy gtkdialog would but didn't. Also gtkwialog removes the need to use /bin/sh stage altogether where applicable, which makes it more efficient overall.
...

wiak

Last edited by wiak on Mon 09 Jul 2018, 02:37; edited 1 time in total
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1227

PostPosted: Thu 07 Jun 2018, 00:24    Post subject:  

wiak wrote:
However, let the gtkdialog faithful continue to use the crippled older legacy gtkdialog mode if so be it.


You say it's faster, so if all the core puppy apps get ported to Gtkwialog, there is a high probability that it will get adopted by most or all puppies, provided that Gtkwialog continues to get maintained.

Clearly it will be the Debian based puppies that will adopt it first. I will note though that if we have to port programs to gtkwialog then it isn't really 100% compatible, and so therefore some may still want to use the old "crippled" version. Or maybe you don't mean port; maybe you mean optimize and forgive me if I missed something in this thread as I can't read everything in the world. Also note that I'm not a developer of a puppy distribution so it isn't up to me whether or not it gets adopted.

Anyway, I appreciate the work of all developers but the great thing about open source is that people can chose to use what they want even if their choice isn't the most optimal based on some criteria...so maybe gtkwialog is the greatest thing since sliced bread but but everyone won't discover whether or not it is so great overnight.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1663
Location: Japan

PostPosted: Thu 07 Jun 2018, 02:17    Post subject:  

wiak wrote:
Thunor got it wrong thinking/suggesting in his linked post above that another solution was to use bash -c before actions in gtkdialog - his suggestion simply doesn't work for legacy gtkdialog

Somehow Thunor's suggestion seems to work for me.
Tested with legacy gtkdialog, /bin/sh linked to /bin/ash.
Code:
#!/bin/bash
func_bash() {
   SYSHELL=$(realpath /bin/sh)
   gxmessage $(cat <(echo "/bin/sh points to $SYSHELL"))
}; export -f func_bash

echo '<button label="Call exported function">
<action>bash -c func_bash</action>
</button>' | gtkdialog -s
Don't know if dash would behave differently from busybox ash.
"bash -c" is also be required when running above script in a standard sh/bash environment.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Thu 07 Jun 2018, 02:28    Post subject:  

s243a wrote:
I will note though that if we have to port programs to gtkwialog then it isn't really 100% compatible, and so therefore some may still want to use the old "crippled" version. Or maybe you don't mean port; maybe you mean optimize and forgive me if I missed something in this thread


gtkwialog (without specifying the new commandline switches) is 100% compatible with legacy gtkdialog and I couldn't care less if it is adopted aside from the fact that it was offered. I document it here mainly for my own notes and stated from the very first that this would be my fork for my own use unless it was clearly wanted by Puppy community; the remarks by some of the more prominent amongst them suggesting that it is more than a pain than a pleasure, so relax.

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Thu 07 Jun 2018, 02:30    Post subject:  

MochiMoppel wrote:
wiak wrote:
Thunor got it wrong thinking/suggesting in his linked post above that another solution was to use bash -c before actions in gtkdialog - his suggestion simply doesn't work for legacy gtkdialog

Somehow Thunor's suggestion seems to work for me.
Tested with legacy gtkdialog, /bin/sh linked to /bin/ash.
Code:
#!/bin/bash
func_bash() {
   SYSHELL=$(realpath /bin/sh)
   gxmessage $(cat <(echo "/bin/sh points to $SYSHELL"))
}; export -f func_bash

echo '<button label="Call exported function">
<action>bash -c func_bash</action>
</button>' | gtkdialog -s
Don't know if dash would behave differently from busybox ash.
"bash -c" is also be required when running above script in a standard sh/bash environment.


Well good for you, use busybox ash then (don't think it worked so well when tried on mistfire's TazPup but maybe those testing it didn't test it as well as you. Interesting though, and I presume you have checked that your /bin/ash is indeed a link to busybox ash and not to bash (maybe others could confirm with their busybox ash?). It doesn't work on dash but you don't need it so that's fine. You've made your point again, and thanks. Actually, maybe it does - can't test at the moment since on wrong machine.

But if others don't have success when now trying their busybox ash, maybe you would be kind enough to post a link to your version so they can try that?

It may be that you are piping into gtkdialog from bash script so function visible at that time (I haven't thought about it as yet). Show a similar example with typical gtkdialog reading from environment variables, which is main problem we are trying to solve really and I will abandon gtkwialog as unneeded.

wiak

EDIT: Above bash -c suggestion only works on busybox ash, NOT on dash-based systems, hence one of many other reasons for there being a continuing need for gtkwialog.

Last edited by wiak on Mon 09 Jul 2018, 02:41; edited 2 times in total
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Thu 07 Jun 2018, 03:08    Post subject:  

comment removed as irrelevant
Last edited by wiak on Mon 09 Jul 2018, 02:31; edited 4 times in total
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1227

PostPosted: Thu 07 Jun 2018, 03:22    Post subject:  

wiak wrote:
Okay, now booted other machine and downloaded busybox from Xenial repos and made /bin/sh link to busybox. Your program does work with that. Good for you and I'm sure you will test it works with other modes of legacy gtkdialog operation (e.g. -p reading dialog from exported variable) - may well do.

I'll just abandon gtkwialog then since not needed and the negatives about it becoming like badgering and a bit of a pain I don't need thanks. But yes, good for you MochiMoppel, you've been trying to push against this development from the start and perseverance has rewarded you. Bravo! Do you happen to go Badger Baiting in your spare time?

Time for me to relax for a long while and enjoy my family, and leave you all to your precious selfs.

wiak


Don't get discouraged. If you believe in it then keep at it but if you think there are better uses of your time then it is your time to do with as you please.

Whether or not you stick with it, please keep gtkwialog in the title so that others can find this thread easier in case they decide to continue your work.

best wishes. I hope that all is well.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Thu 07 Jun 2018, 03:29    Post subject:  

comment removed as irrelevant
Last edited by wiak on Mon 09 Jul 2018, 02:31; edited 4 times in total
Back to top
View user's profile Send private message 
darry19662018

Joined: 31 Mar 2018
Posts: 229

PostPosted: Thu 07 Jun 2018, 03:30    Post subject:  

Damn Gtkwialog had real promise.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1227

PostPosted: Thu 07 Jun 2018, 03:33    Post subject:  

wiak wrote:
Like I said, the project was demeaned as not useful and is now abandoned in its entirety. There is no longer any gtkwialog and no reason for retaining any such title by me. I did what I thought was right and best but thanks first to rcrsn51 and finally to MochiMoppel who made it perfectly clear they did not appreciate my 'tinkering' with legacy gtkdialog, which they insist is fine, I no longer need to think about this further or continue on to its publication. The Puppy Steward's had no interest either - I get the message thanks.


Why is it up to them whether or not you tinker with it, and I hope you abandoned it because of your opinion of the project and not any perceived flack.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1227

PostPosted: Thu 07 Jun 2018, 03:34    Post subject:  

darry19662018 wrote:
Damn Gtkwialog had real promise.


It sounded interesting to me but unfortunately I don't know enough about either it or GTKdialog.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Thu 07 Jun 2018, 03:41    Post subject:  

comment removed as irrelevant
Last edited by wiak on Mon 09 Jul 2018, 02:32; edited 2 times in total
Back to top
View user's profile Send private message 
mcewanw

Joined: 16 Aug 2007
Posts: 3199

PostPosted: Thu 07 Jun 2018, 03:59    Post subject:  

post removed by author as irrelevant
Last edited by mcewanw on Mon 09 Jul 2018, 02:52; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
nosystemdthanks

Joined: 03 May 2018
Posts: 333

PostPosted: Thu 07 Jun 2018, 05:20    Post subject:  

i dont know how much of it is misunderstanding and how much of it is intended to be discouraging.

this is the most pro-remix community i know, but sometimes you stumble into a sacred cow and people start getting out torches and pitchforks.

it should be more like the webcomic freefall-- after every angry chase there is ice cream for those who participated. but people do get discouraged.

i have mixed feelings about gtkdialog, the original:

* just about the coolest thing ever

* a complete mess

i believe fig os (older versions) had gtkdialog because petget called it, and it imported everything it needed for petget to load packages.

other than that: what s243a said. which makes me wonder what word starts with s and is 245 letters long. i can tell you its not in the oed.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 6 of 7 [96 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.1111s ][ Queries: 14 (0.0178s) ][ GZIP on ]