The time now is Thu 25 Feb 2021, 01:09
All times are UTC - 4 |
Author |
Message |
disciple
Joined: 20 May 2006 Posts: 7024 Location: Auckland, New Zealand
|
Posted: Wed 30 May 2018, 01:07 Post subject:
|
|
Hi Wiak,
Having read your latest comment in the other thread, I wonder - why don't you make the recommended behaviour default, and the legacy behaviour a switch, rather than the other way around? If people want to use gtkwialog as a drop in replacement for gtkdialog they could create a suitable alias that will provide the switch, couldn't they?
_________________ Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Wed 30 May 2018, 01:16 Post subject:
|
|
disciple wrote: | Hi Wiak,
Having read your latest comment in the other thread, I wonder - why don't you make the recommended behaviour default, and the legacy behaviour a switch, rather than the other way around? If people want to use gtkwialog as a drop in replacement for gtkdialog they could create a suitable alias that will provide the switch, couldn't they? |
Yes, I prefer that to dissuade others from using old mode that causes problems on dash systems as well documented. However, that would mean that legacy gtkdialog apps would need modification to work with gtkwialog (a switch addition to indicate 'legacy mode'). I decided that proper full backward compatibility could only be achieved if, by default, gtkwialog used legacy gtkdialog mode, to help the current gtkdialog user community. The only thing I am asking for is the name change to gtkwialog to allow proper differentiation of the change; that being agreed I am happy to finally consider gtkwialog being hosted officially on Puppy sites; an alternative could be Dog sites; that doesn't really matter to me - documentation will have to stress that legacy mode is not desired for new apps.
A branch of gtkdialog is really not very acceptable for the reasons I have given - a branch has nothing really to do with the actual name change I feel is appropriate since any branch just gets reabsorbed anyway.
EDIT: Creating a branch in that fashion is therefore very much against my own will as the developer of these additions. However, the overall program is GPLv2 license copyright László Pere so on publishing I cannot force my own will in practice, only in unsatisfied comment.
In the circumstances of that, I think I may aim to host gtkwialog on Dog github if fredx181 agrees to that. Indeed, in the circumstances, that it was Dog developers only who helped with the development testing, that is more appropriate I guess. Puppy Team will of course be free to adopt or not adopt this new alternative.
wiak
Last edited by wiak on Wed 30 May 2018, 03:35; edited 1 time in total
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Wed 30 May 2018, 01:24 Post subject:
|
|
I am determined, by the way, that gtkwialog be my last project (though I will maintain the majority of my work). I decided to retire a couple of years ago, but had weX design at the back of my mind; that remains one of my own favourites but was shown no interest other than by the Dogs. Then, for some unknown reason, I decided to have a go at woof-CE, the result of which being makepup, but aside from one pretty much off-the-cuff remark by one Puppy Steward that project received no interest from Puppy Stewared's Team at all so not sure it was of any use in the end, which is fine, by the way, I am not complaining - may be of no use indeed. Anyway, I had always been annoyed by gtkdialog's behaviour with bash export -f and almost by chance otherwise decided to try and do something about it. A good time to retire I feel. I am happy with gtkwialog.
wiak
EDIT: Because I have allowed gtkdialog mode to be the default in gtkwialog, by the way, in system implementation/install there is no practical problem anyway. If Puppy want to create a dotpet of gtkwialog and call that gtkdialog and rename it as you will internally, it will work out-of-the-box as if it is legacy gtkdialog. So it is not even necessary to have gtkdialog as symlink to gtkwialog on Puppy systems. And since the Dogs are officially considered as being under the Puppy umbrella, hosting gtkwialog on the Debian Dog Organisation github site will keep it in-house anyway.
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Wed 30 May 2018, 03:47 Post subject:
|
|
Temporary download links to the, hopefully and expected, final for-testing-only versions of gtkwialog can now be found in first post of this thread:
http://www.murga-linux.com/puppy/viewtopic.php?p=993434#993434
I will begin work of tidying up and publishing the source code repository of this gtkwialog, gtkdialog fork, within the next day, or two.
The foot of post four of this thread contains some very basic programs you can use should you wish to begin tests of this program:
http://www.murga-linux.com/puppy/viewtopic.php?p=993443#993443
wiak
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Wed 30 May 2018, 04:01 Post subject:
|
|
disciple wrote: | Hi Wiak,
Having read your latest comment in the other thread, I wonder - why don't you make the recommended behaviour default, and the legacy behaviour a switch, rather than the other way around? If people want to use gtkwialog as a drop in replacement for gtkdialog they could create a suitable alias that will provide the switch, couldn't they? |
Possibly a better solution is to create symlink. I don't care whether the symlink is gtkdialog>>gtkwialog or vise-versa but this would eliminate any new and perhaps unnecessary CLI switches and would make gtkwialog a drop in replacement for gtkdialog. Any script requiring the gtkwialog mods can and should be called with the 'gtkwialog' exec; legacy scripts called with 'gtkdialog'.
I am not much of a C programmer but I did manage to do something similar with netmon_wce (to enable wireless polling by default), which @wiak you are quite familiar.
IMHO this could be the best solution and it would be up to a distro builder to adopt gtkwialog or not.
Cheers.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Wed 30 May 2018, 04:34 Post subject:
|
|
01micko wrote: | disciple wrote: | Hi Wiak,
Having read your latest comment in the other thread, I wonder - why don't you make the recommended behaviour default, and the legacy behaviour a switch, rather than the other way around? If people want to use gtkwialog as a drop in replacement for gtkdialog they could create a suitable alias that will provide the switch, couldn't they? |
Possibly a better solution is to create symlink. I don't care whether the symlink is gtkdialog>>gtkwialog or vise-versa but this would eliminate any new and perhaps unnecessary CLI switches and would make gtkwialog a drop in replacement for gtkdialog. Any script requiring the gtkwialog mods can and should be called with the 'gtkwialog' exec; legacy scripts called with 'gtkdialog'. |
Well, I'm presuming you are meaning like symlinks to busybox. That could be used to eliminate commandline switches certainly, though I'm not sure what is wrong with commandline switches anyway. (edit: existing gtkdialog sources already includes code for using commandline switches for other modes, such as debug, which made the additonal switch code addition trivial and straightforward.) There being three modes all of which could be used by default would mean three symlinks. As things stand gtkwialog is a drop in replacement for gtkdialog either by renaming the program or via one symlink (gtkdialog -> gtkwialog, simple as that).
Seems like overkill having to tinker with the code and use time on that further 'multiple-symlink-required' change to be honest, which from my understanding of what you said would require system symlinks:
gtkdialog -> gtkwialog
gtkwialog_mode1 -> gtkwialog
gtkwialog_mode2 -> gtkwialog
Or perhaps I have misunderstood your suggestion?
No new programs have been written to use new modes of gtkwialog as yet so no switches used unnecessarily one way or the other.
wiak
Last edited by wiak on Wed 30 May 2018, 04:56; edited 1 time in total
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Wed 30 May 2018, 04:50 Post subject:
|
|
Anyway, I've been working intensely on this code for some time and was happy to reach an endpoint I am happy with so I can rest for a while.
I will post the repository on Debian Dog Organization site and it is of course GPLv2 per the license requirements. Distribution makers can use or do what they want accordingly. Easiest is just use gtkdialog -> gtkwialog; if you simply want it as a drop in replacement for legacy gtkdialog operation nothing else needs to be done.
wiak
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Wed 30 May 2018, 04:55 Post subject:
|
|
wiak wrote: | Anyway, I've been working intensely on this code for some time and was happy to reach an endpoint I am happy with so I can rest for a while.
I will post the repository on Debian Dog Organization site and it is of course GPLv2 per the license requirements. Distribution makers can use or do what they want accordingly. Easiest is just use gtkdialog -> gtkwialog; if you simply want it as a drop in replacement for legacy gtkdialog operation nothing else needs to be done.
wiak |
OK, enjoy a rest.
I'll delete the branch I made since you aren't interested and that can be the end of it for me as far as I'm involved.
Cheers.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Thu 31 May 2018, 05:25 Post subject:
deb packages released |
|
debian packages for 32bit and 64bit gtkwialog released (currently attached to first post of this thread):
http://www.murga-linux.com/puppy/viewtopic.php?p=993434#993434
As per XenialDog64 these install to /usr/bin
#CHANGES: Minor gtkwialog --version info.
Once you are satisfied they are working correctly you no longer need legacy gtkdialog installed since gtkwialog is fully backwards compatible. Instead you can make /usr/bin/gtkdialog a symlink to gtkwialog since, by default, gtkwialog has been arranged to be a drop-in replacement. NOTE WELL however that such change is at your own risk until the program has been fully tested. However, in my tests the program has operated correctly (USUAL DISCLAIMERS APPLY REGARDING NO GUARANTEES OF FIT FOR PURPOSE)
When writing new programs it is highly recommended, however, that you start gtkwialog with its -b switch for synchronous blocking mode (meaning control won't return to the dialog until command is completed - which is the same as legacy gtkdialog though gtkwialog has advantages as described below). Or use switch -a, instead, if you happen to want asynchronous non-blocking mode (meaning instant return to the dialog leaving the started command running in the background).
Using the -b mode (and the -a mode) has the huge benefit that it allows you to use bash with export -f function_name syntax and the program still operate correctly when system shell is dash (or busybox ash, for example). i.e. the resulting bash/gtkwialog program utilities will be compatible with systems, such as Debian, running dash for /bin/sh, as well as for distributions like Puppy that use bash for /bin/sh
Note that a couple of simple test scripts can be found at the bottom of the following linked post 4 of this thread (along with a somewhat technical explanation of the <action>command_string modes gtkwialog brings):
http://www.murga-linux.com/puppy/viewtopic.php?p=993443#993443
Over the next day or two, I'm working on tidying-up and uploading the gtkwialog source code to Debian Dog Organization page at:
https://github.com/DebianDog/gtkwialog
The program is GPLv2.
wiak
|
Back to top
|
|
 |
smokey01

Joined: 30 Dec 2006 Posts: 2820 Location: South Australia :-(
|
Posted: Thu 31 May 2018, 06:56 Post subject:
|
|
@wiak,
Where does gtkdialog/gtkwialog source the stock icons from. Are they part of the source code?
If so, is it possible to add more?
_________________ Software <-> Distros <-> Tips <-> Newsletters
|
Back to top
|
|
 |
disciple
Joined: 20 May 2006 Posts: 7024 Location: Auckland, New Zealand
|
Posted: Thu 31 May 2018, 07:13 Post subject:
|
|
They are part of gtk, and you can't add more just by putting images somewhere.
_________________ Do you know a good gtkdialog program? Please post a link here
Classic Puppy quotes
ROOT FOREVER
GTK2 FOREVER
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Thu 31 May 2018, 09:12 Post subject:
|
|
disciple wrote: | They are part of gtk, and you can't add more just by putting images somewhere. |
Yes.
https://developer.gnome.org/gtk2/stable/gtk2-Stock-Items.html
You can register your own icons though. This is pinstall from weX:
Code: | #!/bin/sh
gtk-update-icon-cache -f -i /usr/share/icons/hicolor |
weX icon is provided in the dotpet in directory /usr/share/icons/hicolor/48x48/apps/wex48.png
Code: |
<window title=\"weX\" icon-name=\"wex48\" resizable=\"false\"> |
So if you wanted that icon on a button, you could use:
Code: | <button>
<input file icon=\"wex48\"></input>
<variable>WHATEVER</variable>
<action>command_string</action>
</button> |
https://developer.gnome.org/icon-theme-spec/
In wex, though, button icons are in /usr/local/share/pixmaps/wex
They are used directly via their filepath:
Code: | <button tooltip-text=\"$(gettext 'RECORD/CONTINUE RECORD')\">
<input file>/usr/local/share/pixmaps/wex/wex_record.png</input> |
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Thu 31 May 2018, 23:59 Post subject:
|
|
I mentioned that you cannot mix -a and -b modes of gtkwialog. That is not really an issue since most of the time -b (for blocking) would be the best mode to use. However -a (for asynchronous non-blocking) mode is super-efficient for starting up a program effectively in the background, without needing any shell process to also be called for job control purposes (though programmer always has the choice).
Whilst I thus intend the current commandline switch selectable operation 'modes' to remain stable in terms of future compatability, I am looking into adding an optional facility to start up a program in non-blocking background mode even when -b mode otherwise chosen. Then we will get benefit of both at same time - no shell process command required yet with ability to either block till a command finishes before returning control to the dialog or to return immediately (leaving command program fork/exec'd and running in its own process) like with overall -a mode.
I'll only try that alteration in a testing branch however, and it will not at all effect the current gtkwialog operation anyway. i.e. I will ensure the interface remains stable for any additions ensuring full backwards compatibility.
-------------------------
In short explanation:
Neither -a nor -b modes involve running any shell as part of processing an <action>command_string</action>. But one of the jobs of a shell is to provide job control (shell uses a symbol & in relation to that). So if you want to background a process when currently using the gtkwialog -b <action> mode, you would need to start up a shell (since the command_string you give is what you get...):
Code: | <action>sh -c "command &"</action> |
where, command, might for example be leafpad.
whereas, you can fork/exec a process in non-blocking -a mode simply with:
Code: | <action>command</action> | No & symbol being required (and wouldn't mean anything anyway since no shell being used to run this command). In this -a mode once command is fork/exec'd in this way, control returns immediately to the dialog (i.e. non-blocking) so command effectively 'runs in the background' albeit without needing any controlling shell.
Wouldn't it be nice when using the -b mode to also be able to avoid the need for starting up a shell to run a process in its own space (by which I mean fork/exec'd and not blocking). A method for doing that is what I plan to implement, but again it won't upset any current behaviours in my plan (will be using & symbol or similar to simply say use -a mode on this particular <action>. When no shell process is being run the & symbol doesn't mean anything special anyway...).
Funny thing about legacy gtkdialog, if most people were like me, they probably didn't realise a /bin/sh -c process was being used with <action>command_strings</action>. Rather, as programmers, we just came to learn by word of mouth and trial and error, what worked and what didn't (to some extent). Big shock therefore was that bash -f export didn't work with <action>bash -c calls if underlying system shell dash or ash... There would be some other not well understood subtleties. In other words, as I've said before, with legacy gtkdialog, <action>bash -c function_name</action>, for example doesn't mean what it says (bash -c function_name). Rather it means:
/bin/sh -c "bash -c function_name", which is really quite different (i.e. with old gtkdialog you don't really get what you put in... And similarly, other actions don't really do what the visible action command_string syntax alone suggests (you have to always remember that hidden /bin/sh -c with legacy gtkdialog (and some of its negative consequencies).
wiak
Last edited by wiak on Fri 01 Jun 2018, 01:20; edited 1 time in total
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Fri 01 Jun 2018, 01:20 Post subject:
|
|
Aside from the above post idea, my plan is to now create, possibly slightly improved, versions of cast2chrome, precord, and wex, (in that order since I am using cast2chrome on a daily basis myself) that use gtkwialog -b mode such that these will be able to be run in Debian with dash, or Slitaz with ash. Not a big job. Then I'll take a look at some of the Dog utils and tackle some of them if necessary (for my own use at least) in case no-one else finds time for that or chooses not to.
wiak
|
Back to top
|
|
 |
wiak
Joined: 11 Dec 2007 Posts: 2075 Location: not Bulgaria
|
Posted: Sat 02 Jun 2018, 02:53 Post subject:
detaching stdout of <action> commands |
|
Detaching stdout of <action> commands (issue when gtkdialog or gtkwialog output is being assigned to a variable via command-substitution):
An interesting practical and illustrative example discussed on Gtkdialog Tips thread; I've posted gtkwialog related info about it there:
http://www.murga-linux.com/puppy/viewtopic.php?p=994141#994141
|
Back to top
|
|
 |
|
|
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
|