Gtkdialog Development
main1.png = main window on 1st run of Frisbee with the 2 input lines removed - blank - no wifi signals displayed
subsid.png = window after clicking configure network interfaces - with exit button that exits correctly
main2.png = main window on 2nd run of Frisbee - its exit button hangs if the wifi connection is established
subsid.png = window after clicking configure network interfaces - with exit button that exits correctly
main2.png = main window on 2nd run of Frisbee - its exit button hangs if the wifi connection is established
- Attachments
-
- main1.png
- (99.25 KiB) Downloaded 559 times
-
- subsid.png
- (97.97 KiB) Downloaded 563 times
-
- main2.png
- (131.03 KiB) Downloaded 577 times
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I'm going out now.
Thanks for your efforts.
So we've established that Frisbee/gtkdialog3 is not exiting from the exit button on the first tabbed page and that the Frisbee developer needs to quit those progressbar inputs.
That's it. To be honest it's bizarre and I don't really want to spend another day communicating my debugging methodology through a forum. You need somebody with programming skills that can quickly narrow down and isolate the cause on your computer in your house.
What else can I say. Try replacing gtkdialog3 within the code with gtkdialog4 or just gtkdialog. The exit button on the first tabbed page is at line 414: try placing <action>echo EXITING</action> above it and look for it in the terminal. Try placing <action signal=\"hide\">echo HIDING</action> above the </window> tag at line 604. Those progressbar inputs should have an exit condition.
Cheers.
Thanks for your efforts.
So we've established that Frisbee/gtkdialog3 is not exiting from the exit button on the first tabbed page and that the Frisbee developer needs to quit those progressbar inputs.
That's it. To be honest it's bizarre and I don't really want to spend another day communicating my debugging methodology through a forum. You need somebody with programming skills that can quickly narrow down and isolate the cause on your computer in your house.
What else can I say. Try replacing gtkdialog3 within the code with gtkdialog4 or just gtkdialog. The exit button on the first tabbed page is at line 414: try placing <action>echo EXITING</action> above it and look for it in the terminal. Try placing <action signal=\"hide\">echo HIDING</action> above the </window> tag at line 604. Those progressbar inputs should have an exit condition.
Cheers.
Thunor
A quest about r473 - export="false"
This is of course a very handy option. I see clearly how I can include it into pMusic which handles large amount of data in some widgets...
... But, does this has an effect only if <variable> is defined, or does gtkdialog export the content even if no variable is set?
Thank you
Sigmund
A quest about r473 - export="false"
This is of course a very handy option. I see clearly how I can include it into pMusic which handles large amount of data in some widgets...
... But, does this has an effect only if <variable> is defined, or does gtkdialog export the content even if no variable is set?
Thank you
Sigmund
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
It only has an effect if <variable> is defined. gtkdialog does not export the contents of a widget if you haven't given it a name.zigbert wrote:Thunor
A quest about r473 - export="false"
This is of course a very handy option. I see clearly how I can include it into pMusic which handles large amount of data in some widgets...
... But, does this has an effect only if <variable> is defined, or does gtkdialog export the content even if no variable is set?
Thank you
Sigmund
There's a gtkdialog function called variables_export_all() which puts the contents of all widgets into the environment if you have given them a name. This function is called when you run a shell command i.e. in an <action> directive, when you refresh a widget and when you launch a new dialog so I think you can imagine how desirable it would be to stop putting unneccessary data into the environment.
Cheers,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
peebee: I had a think when I was out and I can recommend this to you:
From a terminal, run Frisbee and then press the exit button on the first tabbed page. Does gtkdialog exit or hang? I can't see why it would not exit at this stage because it's a similar exit button to the other one on the second tabbed page.
Let's say it exits cleanly. You know the route that you take through Frisbee to duplicate this problem, so do the next thing whatever that is (ckick a button, select something?) and then click the same exit button. Did it exit cleanly? It did, so do two things and then click the exit button. At some point you are going to find the exact place where the exit button becomes problematic and then we have something to work with. It's important that you only do one more additional thing each time.
Let me know what you find. I can't do anything at the moment except give you advice on how to effectively problem solve.
Regards,
Thunor
From a terminal, run Frisbee and then press the exit button on the first tabbed page. Does gtkdialog exit or hang? I can't see why it would not exit at this stage because it's a similar exit button to the other one on the second tabbed page.
Let's say it exits cleanly. You know the route that you take through Frisbee to duplicate this problem, so do the next thing whatever that is (ckick a button, select something?) and then click the same exit button. Did it exit cleanly? It did, so do two things and then click the exit button. At some point you are going to find the exact place where the exit button becomes problematic and then we have something to work with. It's important that you only do one more additional thing each time.
Let me know what you find. I can't do anything at the moment except give you advice on how to effectively problem solve.
Regards,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Re: Gtkdialog3 problem: Sometimes aborts instead of returning
rerwin and peebee:
Exiting using <action type="exit">Exit-NOW</action> or similar is handled by action_exitprogram()
action_exitprogram() is called by execute_action()
execute_action() for the button clicked signal is called by button_clicked_attr()
I've just tried it myself and you have to echo $RETVALS in the frisbee script and don't forget to rename gtkdialog3 (which I did forget to do) because it's going to be "gtkdialog" wherever you put it.
I recommend that you compile gtkdialog yourselves and place some debugging code into it.rerwin wrote:1. Is there a way to add some debug/troubleshooting logging to gtkdialog to help identify where things go awry? Or is there already someplace to find diagnostic info from gtkdialog?
2. Because this seems, to me, to be a case where a data item is tested but is not the expected data, thus producing random results, could you examine the gtkdialog code that handles the "exit" process to look for a possible bug of that sort?
Exiting using <action type="exit">Exit-NOW</action> or similar is handled by action_exitprogram()
action_exitprogram() is called by execute_action()
execute_action() for the button clicked signal is called by button_clicked_attr()
I've just tried it myself and you have to echo $RETVALS in the frisbee script and don't forget to rename gtkdialog3 (which I did forget to do) because it's going to be "gtkdialog" wherever you put it.
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Helping other people debug is always difficult because everyone has their own method. I try strace and then pepper the hell out of the code near where strace stops with printfs/echoes of sequential numbers, others use a methodical approach, write test code, step through a debugger/tracer. It all depends on whether you are a programmer, "software engineer" or code hacker... or whatever.
Speaking of compiling gtkdialog, I was contemplating trying to build it for win32, but before I even start I know of at least 1 stumbling block. I don't think windows has popen(), (someone correct me if I am mistaken) but glib has a wrapper that should work on both: g_spawn_command_line_async(s,NULL) or one of its relatives.
Can anyone think of others that may be missing?
@thunor - which version would you recommend git, latest stable or is there a new stable just beyond the horizon?
Speaking of compiling gtkdialog, I was contemplating trying to build it for win32, but before I even start I know of at least 1 stumbling block. I don't think windows has popen(), (someone correct me if I am mistaken) but glib has a wrapper that should work on both: g_spawn_command_line_async(s,NULL) or one of its relatives.
Can anyone think of others that may be missing?
@thunor - which version would you recommend git, latest stable or is there a new stable just beyond the horizon?
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
Re: Gtkdialog3 problem: Sometimes aborts instead of returning
[quote="thunor"][/quote]
Hi Thunor
Many, many thanks for your helpful suggestions and patient hand-holding - much appreciated.
With the help of your suggested diagnostic trace outputs and many, many reboots I think I've proved that the problem actually lies in the called Frisbee function "add-profile".
I've generated some diagnostic info from add-profile and sent it off to rerwin - hopefully it will allow him to pinpoint why add-profile in his new version of Frisbee does not return.....
Cheers
peebee
Hi Thunor
Many, many thanks for your helpful suggestions and patient hand-holding - much appreciated.
With the help of your suggested diagnostic trace outputs and many, many reboots I think I've proved that the problem actually lies in the called Frisbee function "add-profile".
I've generated some diagnostic info from add-profile and sent it off to rerwin - hopefully it will allow him to pinpoint why add-profile in his new version of Frisbee does not return.....
Cheers
peebee
LxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Changes in r476:zigbert wrote:...orCode: Select all
<action>[ $FORMAT = flac" ] && disable:BITRATE</action>
...Code: Select all
<action>[ $FORMAT = flac" ] && <action>disable:BITRATE</action></action>
- Added support for:
- <action>if file(filename) function:parameter</action>
- <action>if ! file(filename) function:parameter</action>
- <action>if command(shell command) function:parameter</action>
- <action>if ! command(shell command) function:parameter</action>
With command() -- just as with <action>shell command</action> -- the widget variables are placed into the shell therefore you could conditionally execute code based upon the value of other widgets.
Both the file() and command() functions are expecting true/yes/!0 or false/no/0 so a file will require this data to be within it and a command will require this data to be echoed to stdout.
Is it intuitive? Does it make sense? Otherwise let me know.
I'm going to update the wiki and widget reference now and maybe tweak a couple of things before putting together a source code package release.
Regards,
Thunor
thunor
After a bit testing, this is how I got it working.
Really handy - thanks a lot!!!
After a bit testing, this is how I got it working.
Really handy - thanks a lot!!!
Code: Select all
<comboboxtext width-request="80">
<variable>COPY_FORMAT</variable>
<sensitive>'$VISIBLE_CONVERT'</sensitive>
<item>'$COPY_FORMAT'</item>
<item>aiff</item>
<item>asf</item>
<item>au</item>
<item>flac</item>
<item>mp3</item>
<item>ogg</item>
<item>rm</item>
<item>voc</item>
<item>wav</item>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:COPY_BITRATE</action>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:TXT_COPY_BITRATE</action>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:COPY_SAMPLE</action>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:TXT_COPY_SAMPLE</action>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:COPY_CHANNEL</action>
<action>if command([ $COPY_FORMAT = flac ] && echo true) disable:TXT_COPY_CHANNEL</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_BITRATE</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_BITRATE</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_SAMPLE</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_SAMPLE</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_CHANNEL</action>
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_CHANNEL</action>
</comboboxtext>
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I've just tweaked the code as the "!" not symbol scanning code was not-very-accommodating(tm) so I recommend checking it out (r477).zigbert wrote:thunor
After a bit testing, this is how I got it working.
Really handy - thanks a lot!!!
Code: Select all
<action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_BITRATE</action> <action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_BITRATE</action> <action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_SAMPLE</action> <action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_SAMPLE</action> <action>if command([ $COPY_FORMAT != flac ] && echo false) enable:COPY_CHANNEL</action> <action>if command([ $COPY_FORMAT != flac ] && echo false) enable:TXT_COPY_CHANNEL</action> </comboboxtext>
Which means that the last 6 lines above will correctly be <action>if command([ $COPY_FORMAT != flac ] && echo true) enable: ...
Yeah, this will be handy for lots of things I'm sure. I'm writing an application and I want to do a conditional exit which is now possible, well I guess it was before with the checkbox trick but I think that that laborious trick is now redundant.
Regards,
Thunor
As I see it, the checkbox trick is still the best solution where several widgets wants to refresh (parts) of the gui. Ie. in pMusic there are plenty of occasions to update the playlist/window-title/albumart/... (or the trackinfo window that contain heaps of widgets to refresh). Much easier with one checkbox than conditional <action> code in all related widgets.thunor wrote:I want to do a conditional exit which is now possible, well I guess it was before with the checkbox trick but I think that that laborious trick is now redundant.
All good stuff!!!
Sigmund
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Regarding the recent conditional execution code, I'm investigating moving it to something like <action condition="if ! command(shellcommand)">function:parameter</action> because it's more integrated into how gtkdialog deals with everything and I'm thinking about the possible expansion of this feature at a later date, so carry on using it but you might have to slightly modify it. Hey, that's what it's like living on the cutting edge
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
Changes in r479:
Cheers,
Thunor
- Moved the action conditions into their own tag attribute belonging to the action directive e.g. <action condition="if file(filename)">...
- Added support for:
- condition="if active(varname)",
- condition="if sensitive(varname)",
- condition="if visible(varname)" and it's trivial to add more.
Cheers,
Thunor
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I guess everyone who's written a gtkdialog application will have experienced the following issue although I know that I've become accustomed to working around it -- I'm talking about the escaped double-quotes problem.
When constructing the contents of an action you know that if you wrap the lot in double-quotes then you can't use double-quotes inside unless you escape them, but the escapes (backslashes) remain within the string i.e. there's no processing of these to remove the backslashes from the front of double-quotes so you end up with this:
echoing this:
The advantage of wrapping the action's contents in double-quotes is that you can split complex actions across multiple lines, but the moment you need to embed double-quotes it all falls apart. The solution to this which most people are aware of is not to wrap everything in double-quotes but to write everything on one long line. Ok, so at least there's a workaround to that problem but it can't be fixed because escaped double-quotes within existing applications should really be escaped escaped double-quotes.
The recently added condition tag attribute belonging to the action directive initially presented me with the problem that the contents of a tag attribute are wrapped in mandatory double-quotes so you can't work around them, but since this is a new feature and would be rather limited if you couldn't properly embed double-quotes, I scan the string and remove the backslash from the front of double-quotes.
So far so good, except that there's some weird stuff going on with backslashes within tag attributes:
The shell correctly removes the escape character from the space in the first action, and the second results in everything up to "text" being cut! I'm sure that the parser rules are responsible for this and fixing it should be achievable, but you should be aware that it exists although if it happens in a condition tag attribute then it'll cut the function name and you'll get a warning message about it being unknown.
Cheers,
Thunor
When constructing the contents of an action you know that if you wrap the lot in double-quotes then you can't use double-quotes inside unless you escape them, but the escapes (backslashes) remain within the string i.e. there's no processing of these to remove the backslashes from the front of double-quotes so you end up with this:
Code: Select all
<action>"echo \"sometext\""</action>
Code: Select all
"sometext"
The recently added condition tag attribute belonging to the action directive initially presented me with the problem that the contents of a tag attribute are wrapped in mandatory double-quotes so you can't work around them, but since this is a new feature and would be rather limited if you couldn't properly embed double-quotes, I scan the string and remove the backslash from the front of double-quotes.
So far so good, except that there's some weird stuff going on with backslashes within tag attributes:
Code: Select all
<button>
<action>echo some\ text</action>
<action>"echo some\ text"</action>
</button>
Cheers,
Thunor
r479
I expected this code to work, but the enable-function is not activated.I fixed it like this
Great stuff
Sigmund
I expected this code to work, but the enable-function is not activated.
Code: Select all
<action condition="if command([ $COPY_FORMAT = flac ] && echo true)">disable:COPY_BITRATE</action>
<action condition="if command([ $COPY_FORMAT != flac ] && echo false)">enable:COPY_BITRATE</action>
Code: Select all
<action>enable:COPY_BITRATE</action>
<action condition="if command([ $COPY_FORMAT = flac ] && echo true)">disable:COPY_BITRATE</action>
Great stuff
Sigmund
- thunor
- Posts: 350
- Joined: Thu 14 Oct 2010, 15:24
- Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
- Contact:
I was a bit ambiguous about what exactly the functions are expecting:zigbert wrote:...I fixed it like thisCode: Select all
<action condition="if command([ $COPY_FORMAT != flac ] && echo false)">enable:COPY_BITRATE</action>
...Code: Select all
<action condition="if command([ $COPY_FORMAT = flac ] && echo true)">disable:COPY_BITRATE</action>
if function(argument) will expect "true", "yes" or a value that isn't zero e.g. "-89" or "18" to evaluate as true else it'll evaluate as false.
if ! function(argument) will expect "false", "no" or "0" to evaluate as true else it'll evaluate as false.
Basically what I'm doing here is if function(argument) = "true" and if function(argument) = "false" but in a simpler way.
It's like the existing prefix "if true function:parameter" and "if false function:parameter" for toggling widgets but I've replaced the true and false with functions. I can see though that people will think that "!" is actually notting.
Ok, maybe I should use if function_is_true(argument) and if function_is_false(argument) which is clearer right? I'm going to think about it.
[EDIT] I'm changing it now...
[EDIT2] Checkout/update to r480 please. It's now "if function_is_true(argument)" and "if function_is_false(argument)" which is much clearer.
Cheers,
Thunor