[SOLVED] Snap2 under different versions of gtkdialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

[SOLVED] Snap2 under different versions of gtkdialog

#1 Post by peebee »

The assistance of gtkdialog experts would be appreciated....

Trying to get the very useful Snap2 backup utility working on upcoming Puppies but I get 3 different outcomes with the same source depending on which version of gtkdialog is implemented.

Snap2 Version 4.25 is being tested. http://murga-linux.com/puppy/viewtopic.php?t=50402

The main dialogue code is attached - the gtkdialog call is on line 659 and the initial startup window is defined on line 515

If I run snap2 in a terminal in Upup Precise 54x4 with gtkdialog version 0.8.3 r473M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor Built with additional support for: Glade.....
I get the following errors and the main dialogue window does not open

Code: Select all

widget_entry_refresh(): <label> not implemented for this widget.
widget_entry_refresh(): <label> not implemented for this widget.
widget_entry_refresh(): <label> not implemented for this widget.
widget_combobox_input_by_command(): <input> not implemented for this widget.
If I run it in a terminal in Slacko 5.3.9.5 with gtkdialog version 0.8.2 r455M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor Built with additional support for: Glade, VTE.....
I get the same errors but the main dialogue window does appear and seems to work.

If I run it in a terminal in Puppy Precise 5.4.2 or Slacko 5.3.3 with gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor...........
then the errors do not appear.

Can anybody suggest what gtkdialog constructs might have changed between the different versions that I might need to look at to track down this problem - many thanks.

Cheers
peebee
Attachments
snap2.gz
open as text
(62.45 KiB) Downloaded 584 times
Last edited by peebee on Sun 16 Dec 2012, 07:45, edited 1 time in total.
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#2 Post by vovchik »

Dear peebee,

Why not checkout gtkdialog from google code and compile it? Great way to find out what might be missing.....

With kind regards,
vovchik

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

Re: Snap2 different under different versions of gtkdialog

#3 Post by thunor »

peebee wrote:...
If I run snap2 in a terminal in Upup Precise 54x4 with gtkdialog version 0.8.3 r473M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor Built with additional support for: Glade.....
I get the following errors and the main dialogue window does not open

Code: Select all

widget_entry_refresh(): <label> not implemented for this widget.
widget_entry_refresh(): <label> not implemented for this widget.
widget_entry_refresh(): <label> not implemented for this widget.
widget_combobox_input_by_command(): <input> not implemented for this widget.
If I run it in a terminal in Slacko 5.3.9.5 with gtkdialog version 0.8.2 r455M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor Built with additional support for: Glade, VTE.....
I get the same errors but the main dialogue window does appear and seems to work.

If I run it in a terminal in Puppy Precise 5.4.2 or Slacko 5.3.3 with gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor...........
then the errors do not appear.

Can anybody suggest what gtkdialog constructs might have changed between the different versions that I might need to look at to track down this problem - many thanks.
...
Hi peebee

I saw this "widget_entry_refresh(): <label> not implemented for this widget." message recently with examples/miscellaneous/fileselect_deprecated.

I've been refactoring the code and moving stuff that was everywhere into its own file based on a template. If a widget doesn't support a directive then you'll get a warning message but it's just a warning. In this case the fileselect function is using the entry widget's label directive to store the text that's displayed in the title of the fileselect dialog, but that was the old way to do it and it's still supported although the template isn't compensating for that which I only recently noticed. Technically the entry widget does not support the label directive so I'd rather leave it as is because there is a better and more consistent way to store the text which is with the fs-title custom tag attribute.

If you want to remove these warnings then:
Move the "Select a Directory" text at line 478 into the entry tag using fs-title="Select a Directory" and delete the <label></label>.
Do the same at lines 500 and 517.

The combobox warning message is interesting. The combobox widget does not support the input directive and in fact there is an example in examples/combobox/combobox_input which states this -- maybe it was going to be implemented and an example was created for it but it wasn't -- and within the snap2 code at line 631 is "<input>ls</input>" which I'm guessing was copied and pasted from the broken example so just remove it. It was never implemented but warning messages are a new feature therefore the original developer simply left it in because I guess he forgot it was there.

I don't like the fact that the window doesn't show on Upup Precise 54x4 with gtkdialog version 0.8.3 r473. I suggest checking out the latest gtkdialog version from SVN which is now at r493. I'm going to try it myself.

Code: Select all

svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog
cd gtkdialog
./autogen.sh
make
Edit snap2 and point to the gtkdialog binary that will be in the src subdirectory or move the binary somewhere else.

Regards,
Thunor

P.S. The snap2.gz download above is actually the source with a gz extension, it's not gzipped.

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#4 Post by pemasu »

Upup Precise will have this gtkdialog version in next build:
# gtkdialog --version
gtkdialog version 0.8.3 r491M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Built with additional support for: Glade.

I noticed that pdvdrsab didnt work with previous gtkdialog version either. I hope this version is more compliant.

The development is so fast that keeping up with new revisons is real race....lol....nice race though.
Thanks Thunor.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#5 Post by thunor »

pemasu wrote:...
I noticed that pdvdrsab didnt work with previous gtkdialog version either. I hope this version is more compliant.
...
Hi pemasu

I'm currently playing with Upup Precise 54X4 (which is very nice so thank you) and pdvdrsab shows but there's no DVD drive listed although I do have one at /dev/sr0 (CD/DVD Drive Wizard also agrees). The code that is responsible for this is at line 103 and it won't result in anything because it's grepping for "cd-*rom" when probedisk isn't outputting text like that. There are also four dialogs in there which are launched with missing variable directives and the closewindow code is invalid so the quit buttons don't work. I haven't tried ripping anything. I think that the application requires some maintenance. Is anyone maintaining it? These issues are application issues, they are not gtkdialog issues.

snap2 shows for me. I get an initial small dialog saying "Warning: there are missing programs..." and then I get the main dialog so I've tested it to show which is what I wanted.

Regards,
Thunor

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#6 Post by pemasu »

Until now that is. The next Puppy4 release will have Pdvdrsab, which is jason's next-generation DVD "rip, shrink, author, burn" (rsab) GUI application.
Jason (plinej in the forum)

Quote from Barry`s blog. Plinej is still around. I could pm him about your findings.

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#7 Post by thunor »

pemasu wrote:
Until now that is. The next Puppy4 release will have Pdvdrsab, which is jason's next-generation DVD "rip, shrink, author, burn" (rsab) GUI application.
Jason (plinej in the forum)

Quote from Barry`s blog. Plinej is still around. I could pm him about your findings.
I've found Pdvdrsab-0.1 - a gtkdialog dvd rip/shrink/author/burn gui so I'll explain it in there.

[EDIT] plinej posted on Sun 28 Jun 2009 "I'm pretty much done with this code and anyone is free to expand on it to fix bugs and add features. I just don't have the time anymore."

Also it seems as though a chap called Rocket has already found these issues and fixed them, so we're obviously not using Rocket's fixed version.

It sure would make life a lot easier if somebody would create a repository for Puppy apps so that folk can fix these things at source. Then Puppy releases would simply take the source from the repository rather than having modified gzipped apps, patch files and code posted in threads that may or may not get somebody's attention. It could be a great deal easier to maintain this stuff -- just a suggestion, I'm not being critical.

Anway, Rocket's version of pdvdrsab works fine, I've just ripped 100MB of a DVD to test and there are no compliancy issues so I'm going away now :)

Cheers,
Thunor

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

Re: Snap2 different under different versions of gtkdialog

#8 Post by peebee »

thunor wrote:If you want to remove these warnings then:
Move the "Select a Directory" text at line 478 into the entry tag using fs-title="Select a Directory" and delete the <label></label>.
Do the same at lines 500 and 517.

The combobox warning message is interesting. The combobox widget does not support the input directive and in fact there is an example in examples/combobox/combobox_input which states this -- maybe it was going to be implemented and an example was created for it but it wasn't -- and within the snap2 code at line 631 is "<input>ls</input>" which I'm guessing was copied and pasted from the broken example so just remove it.
Hi Thunor

Many thanks for the patches which I can confirm get rid of the warning messages.

However they unfortunately don't make snap2 work on Upup Precise 5.4.X.4

The difference with Slacko 5.4 where Snap2 4.25 does work correctly is that a warning box appears instead of the main window when Snap2 is started and when the warning box is closed the main window opens but on tab #2 and if tab #1 is clicked the warning box reappears.

So Snap2 4.25 is still behaving inconsistently on 2 modern Puppies both with modern but different versions of gtkdialog....

I haven't tried your even newer version of gtkdialog yet....maybe pemasu can see how Snap2 works on his new Upup Precise 5.4.X.n - or I can test when he uploads it.

Thanks for your interest and suggestions
Cheers
PeeBee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

Re: Snap2 different under different versions of gtkdialog

#9 Post by thunor »

peebee wrote:...
However they unfortunately don't make snap2 work on Upup Precise 5.4.X.4

The difference with Slacko 5.4 where Snap2 4.25 does work correctly is that a warning box appears instead of the main window when Snap2 is started and when the warning box is closed the main window opens but on tab #2 and if tab #1 is clicked the warning box reappears.

So Snap2 4.25 is still behaving inconsistently on 2 modern Puppies both with modern but different versions of gtkdialog....

I haven't tried your even newer version of gtkdialog yet...
What is the text within the initial warning box?

There are six tabs within the main window and they all have text on them, so it's not possible to identify what you mean by tab #2 and tab #1. What is the text on tab #2? What is the text on tab #1?

What is the text within the warning box that shows when clicking tab #1?

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

Re: Snap2 different under different versions of gtkdialog

#10 Post by peebee »

thunor wrote:What is the text within the initial warning box?

There are six tabs within the main window and they all have text on them, so it's not possible to identify what you mean by tab #2 and tab #1. What is the text on tab #2? What is the text on tab #1?

What is the text within the warning box that shows when clicking tab #1?
Hi Thunor

Screenie 1 shows the warning box

Reading from the left on the main window - screenie 2 -

tab#1 = DIRECTORIES TO BACKUP
tab#2 = BACKUP STORAGE

After closing the initial warning box, tab#2 is selected and displayed.

Clicking tab#1 bring up an identical warning box - i.e screenie 1 again.

Cheers
PeeBee
Attachments
capture17973.png
screenie 1
(6.87 KiB) Downloaded 742 times
capture18745.png
screenie 2
(41.67 KiB) Downloaded 752 times
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#11 Post by pemasu »

The central repository system for woof builders is the official repos updated by Barry Kauler. That is the place where bug fixed pets should end.

I posted about your finding and fixed pdvdrsab script to the Barry`s blog:
http://bkhome.org/blog2/?viewDetailed=00064

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#12 Post by thunor »

@peebee

Thanks for that. I've installed snap2 v4.25 from here and I've started it up in Upup Precise 54x4 with gtkdialog version 0.8.3 r493 and I don't see that message box.

I've looked through the snap2 code and I've read your post to lstandish.

As I've said before, all the gtkdialog code has been gradually moving across to using a new template that warns developers if they use directives that aren't supported for certain widgets which is a good thing because it helps to catch things like that unsupported combobox <input>ls</input> sitting there dormant waiting to explode when I implement <input> for that widget (I won't though because it's too old and deprecated). This is fine except that I have seen developers using:

Code: Select all

eval `gtkdialog -p MAIN_DIALOG`
or similar which evaluates everything sent to stdout which could be anything from anywhere. I can see that the following code:

Code: Select all

I=$IFS; IFS=""
for STATEMENTS in  $($GTKDIALOG --program=MSG_DIALOG); do
	eval $STATEMENTS
done
IFS=$I
is being used in several places within the snap2 source code so I would recommend modifying that at least for you to test. You should try adding " | grep =" to the end of the GKDIALOG part so that you'll get something like:

Code: Select all

for STATEMENTS in  $($GTKDIALOG --program=MSG_DIALOG | grep =); do
Have a go with that. There are seven of them, search for "eval".

@pemasu
Excellent.

Regards,
Thunor

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#13 Post by peebee »

thunor wrote:

Code: Select all

for STATEMENTS in  $($GTKDIALOG --program=MSG_DIALOG | grep =); do
Have a go with that. There are seven of them, search for "eval".
Hi Thunor

Made the changes you suggested - did not change behaviour on Upup Precise 54x4......still warning and not possible to select tab#1

Is there any diagnostic info I can add / generate to help track down where the problem is?

Thanks for your interest and efforts.
Cheers
PeeBee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#14 Post by pemasu »

I haven't tried your even newer version of gtkdialog yet....maybe pemasu can see how Snap2 works on his new Upup Precise 5.4.X.n - or I can test when he uploads it.
Why not try with latest gtkdialog revision. It might make the difference. I am going to update to the latest revision anyway.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#15 Post by peebee »

pemasu wrote:
I haven't tried your even newer version of gtkdialog yet....maybe pemasu can see how Snap2 works on his new Upup Precise 5.4.X.n - or I can test when he uploads it.
Why not try with latest gtkdialog revision. It might make the difference. I am going to update to the latest revision anyway.
Hi Pemasu

I guess I was feeling that that was a bit beyond my capabilities....

Thunor gave me some pointers above:

Code: Select all

svn checkout http://gtkdialog.googlecode.com/svn/trunk/ gtkdialog 
cd gtkdialog 
./autogen.sh 
make

Edit snap2 and point to the gtkdialog binary that will be in the src subdirectory or move the binary somewhere else. 
but I assume I would need to download the devx for this to work?

Thanks
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#16 Post by thunor »

peebee wrote:...
Made the changes you suggested - did not change behaviour on Upup Precise 54x4......still warning and not possible to select tab#1
...
I've been studying the snap2 code and this is how I think it works:

There's a big while loop at line 249 which looks as though it envelopes the entire application and this is used to restart it. When the main dialog exits, its output is evaluated and if you haven't supplied some necessary information then you'll get a warning in a message box, a variable called maintab will be set to something and then it goes back to the top of the while loop and runs again which will present the tab associated with the widget that you must enter data into.

You should see the main dialog first (line 659), then the message box (line 1288) and then the main dialog restarts showing the BACKUP STORAGE tab. Well, that's under normal operation if the conditions are met at line 1286 -- $dst = "none" or $dst = "". So, you're seeing the message box first, then the main dialog showing the BACKUP STORAGE tab (#2), then you click the DIRECTORIES TO BACK UP tab (#1) which causes the same message box to reappear (is the main dialog still open now or not?).

I'm going to guess that the execution of the main dialog at line 659 initially falied, but you can't tell because all of the output is being captured in a variable, evaluated and then discarded and because it didn't run, there's no valid output to evaluate so $dst = "none" or $dst = "" causes the messsage box to appear. Then we go back to the top of the while loop and do it again but this time the main dialog does appear and then I don't know after that. There's a possibility that something on the DIRECTORIES TO BACK UP tab (#1) is causing it to crash but this isn't activated when the application restarts showing the BACKUP STORAGE tab (#2) which is why you can see it. Sherlock Holmes: eat my deerstalker :P

I recommend that above the code that invokes the main dialog (line 659) you should simply try $GTKDIALOG --program=MAIN_DIALOG; exit and then dump the output here. You'll want to put this underneath the debugging message #echo "$MAIN_DIALOG" which is at line 655.

Regards,
Thunor
Last edited by thunor on Wed 12 Dec 2012, 15:22, edited 2 times in total.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#17 Post by peebee »

Hi Thunor & Pemasu

I'll try the above shortly and report the results...

In the meantime I've tried a regression of gtkdialog in Upup Precise 54x4 to an earlier version.

In doing so I have noticed that Upup Precise has a different code structure to BK's Precise 5.4.2...

Precise 5.4.2 has "real" gtkdialog3 and gtkdialog4 with gtkdialog being a symlink to gtkdialog4

Upup Precise 54x4 has a "real" gtkdialog with gtkdialog3 and gtkdialg4 being symlinked to it.

My test consisted of replacing all of gtkdialog, -3 and -4 with the Precise 5..4.2 components.

With this change - Snap2 works as expected.

Back soon.
Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#18 Post by peebee »

Back with testing results.....on Upup Precise 54x4

Inserting the line suggested by Thunor into snap2 and then running in a terminal gives:

Code: Select all

# snap2
/usr/bin/snap2: line 1511: 17541 Segmentation fault      $GTKDIALOG --program=MAIN_DIALOG
# 
This is with the edited version of snap2 with Thunor's previously advised changes.

Line 1511 is the final line in the file - "done"

Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#19 Post by thunor »

Great, well, good and bad at the same time :)

Same again please, but use this line instead:

Code: Select all

$GTKDIALOG -v; echo "$MAIN_DIALOG" > /tmp/snap2_MAIN_DIALOG; $GTKDIALOG --program=MAIN_DIALOG; exit
Show the output of that line, gzip /tmp/snap2_MAIN_DIALOG and attach it.

Thank you.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#20 Post by peebee »

thunor wrote:Show the output of that line, gzip /tmp/snap2_MAIN_DIALOG and attach it.

Code: Select all

# snap2
gtkdialog version 0.8.3 r473M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Built with additional support for: Glade.
/usr/bin/snap2: line 1511: 17738 Segmentation fault      $GTKDIALOG --program=MAIN_DIALOG
# 
Attachments
snap2_MAIN_DIALOG.gz
(3.35 KiB) Downloaded 454 times
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

Post Reply