Problem converting gtkdialog3 script to gtkdialog4 (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

Problem converting gtkdialog3 script to gtkdialog4 (Solved)

#1 Post by Argolance »

Hello,
I am trying to convert a gtkdialog3 script into gtkdialog4 (to take advantage of the great enhancements cooked by Thunor!) but something is going wrong and xerrs.log sends:
(gtkdialog4:14229): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-press' is invalid for instance `0x8a25978'

(gtkdialog4:14229): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-release' is invalid for instance `0x8a25978'
I think something is deprecated but don't see exactly what. I thought it was <visible>...</visible> tags I changed into <sensitive>...</sensitive>, but error message stays!

Thank you for your attention.

Cordialement.
Last edited by Argolance on Fri 11 Nov 2011, 16:20, edited 1 time in total.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#2 Post by Argolance »

Hello,
I found the same error message while testing this script inside the gtkdialog svn repository (gtkdialog-read-only/examples/progressbar/progressbar_test):
#!/bin/sh

GTKDIALOG=gtkdialog #gtkdialog renamed as gtkdialog4 for testing => /usr/sbin/gtkdialog4

progress() {
for i in $(seq 0 10 100); do
echo $i
[ "$i" -le 30 ] && echo "Start..."
[ "$i" -le 60 -a "$i" -gt 30 ] && echo "Middle..."
[ "$i" -gt 60 ] && echo "End..."
sleep 0.3
done;
echo ready
}; export -f progress

progress_fast() {
for i in $(seq 0 1 10000); do
echo $((i/100))
[ "$i" -le 3000 ] && echo "Start..."
[ "$i" -le 6000 -a "$i" -gt 3000 ] && echo "Middle..."
[ "$i" -gt 6000 ] && echo "End..."
#sleep 0.1
done;
echo ready
}; export -f progress_fast

export BAR_DIALOG='
<variable>BAR_DIALOG</variable>
<vbox>
<frame Progress>
<text>
<label>Some text describing what is happening.</label>
</text>
<progressbar>
<variable>PROGRESS_BAR</variable>
<label>Some Text</label>
<input>progress_fast</input>
<action type="refresh">ENTRY</action>
<action type="closewindow">BAR_DIALOG</action>
<action>echo ready</action>
</progressbar>
</frame>
<hbox>
<button cancel>
<action type="closewindow">BAR_DIALOG</action>
</button>
</hbox>
</vbox>
'

export MAIN_DIALOG='
<vbox>
<entry>
<variable>ENTRY</variable>
<input>date</input>
</entry>
<hbox>
<button cancel></button>
<button>
<label>Launch</label>
<action type="launch">BAR_DIALOG</action>
</button>
<button>
<label>Close</label>
<action type="exit">CLOSE</action>
</button>
</hbox>
</vbox>
'

case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
Nobody interesting in this issue? :cry:

Cordialement.

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post by 8-bit »

I just tried the script you posted as well as the one, "progressbar_test", in the examples for gtkdialog rev 8.
If I do not Close after the first time I click the Launch button, and instead click on the Launch button again, I get an error of:

** ERROR **: gtkdialog: Error in line 41, near token 'string': syntax error

So some setup is not being made for a repeat of Launching the child window.

I have not examined the code fully. But it looks like an error to me.

Also, just changing the script back to gktdialog3 gets it to run consistently with no errors.

So It looks like you have found a reportable bug.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#4 Post by Argolance »

Hello 8-bit,
Thanks for replying!
So It looks like you have found a reportable bug.
Was not sure but it's what I thought...
Now, where should this expected 'bug' be reported?
Also, just changing the script back to gktdialog3 gets it to run consistently with no errors.
...In any case I give up for my own script! :cry:

Cordialement.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#5 Post by jpeps »

Looks like something in the refresh command:

Code: Select all

 
<actiontype="refresh">ENTRY</action>
edit: you can update the date from another button in MAIN:

Code: Select all

<button>
<label>REFRESH</label>
<action>refresh:ENTRY</action>
</button>

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#6 Post by 8-bit »

The date/time is part of the script that would as placed show original time vs ending time for the progress bar to complete.
As to why gtkdialog3 handles it and gtkdialog doesn't when the Launch button is pressed twice evidently has something to do with the progressbar widget.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#7 Post by disciple »

Argolance wrote:Now, where should this expected 'bug' be reported.
Gtkdialog has a bug tracker at http://code.google.com/p/gtkdialog/, or you could probably post in the "gtkdialog development" thread here.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

Re: gtkdialog3 script into gtkdialog4 problem...

#8 Post by thunor »

Argolance wrote:...
(gtkdialog4:14229): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-press' is invalid for instance `0x8a25978'

(gtkdialog4:14229): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-release' is invalid for instance `0x8a25978'
...
Hi Argolance

So the only problem is that you are seeing these messages?

The "icon-press" and "icon-release" signals require GTK+ >= 2.16.0, therefore support for these signals will be compiled-in to the gtkdialog binary if the person who compiled it had GTK+ >= 2.16.0.

I've tried your script on lupu-520 with GTK+ 2.20.0 and a self compiled gtkdialog 0.8.1 and I don't see these messages. Is anyone else seeing these messages?

Since these signals are only connected-up for the entry widget, you should be able to reproduce these messages by simply creating an app with just one entry widget.

You need to tell us which version of GTK+ you are using etc.. You can get your GTK+ version number from /usr/include/gtk-2.0/gtk/gtkversion.h.

Regards,
Thunor

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#9 Post by Argolance »

Hello,
Thanks for replying.
So the only problem is that you are seeing these messages?
This seems to be...
You need to tell us which version of GTK+ you are using etc.. You can get your GTK+ version number from /usr/include/gtk-2.0/gtk/gtkversion.h.
Sorry! I am running Toutou/Puppy 4.31, GTK+ version 2 and a self compiled gtkdialog 0.8.1 from svn repository.
Scripts I converted that have no 'entries' don't send any errors messages.
So, the problem appears to be 'virtually' solved...

Thanks thunor for your great work that is surely contributing to make Puppy much better and... attractive!

Regards.

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

#10 Post by thunor »

Argolance wrote:...I am running Toutou/Puppy 4.31, GTK+ version 2 and a self compiled gtkdialog 0.8.1 from svn repository.
Scripts I converted that have no 'entries' don't send any errors messages.
So, the problem appears to be 'virtually' solved...
...
Toutou/Puppy 4.31 = GTK+ 2.14.7

Therefore if you compiled gtkdialog on your computer then GObject shouldn't be complaining about "icon-press" and "icon-release" because the code for these signals wouldn't have been compiled-in.

http://code.google.com/p/gtkdialog/sour ... gets.c#797
http://code.google.com/p/gtkdialog/sour ... tton.c#289

I'm guessing that those messages came from a prebuilt gtkdialog binary package that was compiled on a machine with a version of GTK+ >= 2.16.0 i.e. gtkdialog4 and you are running it with a 2.14.7 GLib-GObject (is that possible? I don't know) and when gtkdialog connects the "icon-press" and "icon-release" signals to entry widgets your GObject doesn't know what these signals are so it displays error messages.

You can run this and post the output if you'd like to investigate this further:

Code: Select all

#!/bin/sh 

GTKDIALOG=gtkdialog

GTKVERSION="find /usr/include -name gtkversion.h"

$GTKDIALOG -v
$GTKVERSION
cat `$GTKVERSION` | grep "define GTK_M"

export MAIN_DIALOG='
<window title="Argolance - Signal Issue" resizable="false">
	<vbox border-width="50">
		<entry></entry>
		<spinbutton></spinbutton>
		<hseparator></hseparator>
		<button ok></button>
	</vbox>
	<action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG 
Regards,
Thunor

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#11 Post by Argolance »

Hello Thunor!
You can run this and post the output if you'd like to investigate this further:
Yes, I would like! :D
gtkdialog version 0.8.1 (C) 2003-2007 Laszlo Pere, 2011 Thunor
/usr/include/gtk-2.0/gtk/gtkversion.h
#define GTK_MAJOR_VERSION (2)
#define GTK_MINOR_VERSION (14)
#define GTK_MICRO_VERSION (7)

(gtkdialog4:1444): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-press' is invalid for instance `0x891d028'

(gtkdialog4:1444): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-release' is invalid for instance `0x891d028'

(gtkdialog4:1444): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-press' is invalid for instance `0x892d010'

(gtkdialog4:1444): GLib-GObject-WARNING **: gsignal.c:2267: signal `icon-release' is invalid for instance `0x892d010'
EXIT="OK"
Script completed hit RETURN to close window.
Sorry, I understand now that I had to give you the 3 MAJOR MINOR MICRO numbers as shown above... :oops:

Regards.

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 »

As I've shown above, the code for these signals isn't compiled-in unless you have GTK+ >= 2.16.0 so at the moment this makes no sense :?

I can't trace this myself so this is what you could do next:

* Change into your /tmp directory and check-out gtkdialog from SVN.
* Edit widget_spinbutton.c and uncomment "//#define DEBUG_TRANSITS" at the top.
* ./autogen.sh && make but don't install it.
* Copy the following script into the src folder and run it.
* Post the output.

Code: Select all

#!/bin/sh 

GTKDIALOG=./gtkdialog

export MAIN_DIALOG='
<window title="Argolance - Signal Issue2" resizable="false">
	<vbox border-width="50">
		<spinbutton></spinbutton>
		<hseparator></hseparator>
		<button ok></button>
	</vbox>
	<action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG 
Regards,
Thunor

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#13 Post by Argolance »

Hello Thunor,
Don't know exactly what's' happening under-the-hood but I strictly and stupidly did what you say. :oops:
Note: my svn gtkdialog was not downloaded in the /tmp folder but in the /root folder. Don't know if it is important?
Then, while running the command './autogen.sh && make' in console after modifying widget_spinbutton.c, I got 2 errors. Please see the attached text file.
Question:
Is it right uncommented?
[...]
/* Defines */
//#define DEBUG_CONTENT
define DEBUG_TRANSITS
[...]
At last when I ran the script in console, I got:
/root/gtkdialog/src/sans titre: line 16: ./gtkdialog: Aucun fichier ou répertoire de ce type
Script completed hit RETURN to close window.
Did I forget something?

Regards.
Attachments
terminal.tar
(23.5 KiB) Downloaded 316 times

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

#14 Post by thunor »

Argolance wrote:...
[...]
/* Defines */
//#define DEBUG_CONTENT
define DEBUG_TRANSITS
[...]
...
It should be

Code: Select all

/* Defines */
//#define DEBUG_CONTENT
#define DEBUG_TRANSITS
Type make again and then run the script I gave you and show me the output :)

Thanks,
Thunor

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#15 Post by Argolance »

Hello Thunor,
It should be
I said 'stupidly'... :oops:
So, this time all ran as well as possible! :D. No error.
Output is :

Code: Select all

widget_spinbutton_create(): Entering.
widget_spinbutton_create(): Exiting.
widget_spinbutton_refresh(): Entering.
widget_spinbutton_refresh(): Exiting.
EXIT="OK"
Script completed hit RETURN to close window.
Regards.

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 »

Argolance wrote:...
So, this time all ran as well as possible! :D. No error.
...
Yeah, no "icon-press" nor "icon-release" error messages, but I haven't done anything other than display some debugging information. The errors don't appear because you've compiled it on your computer against GTK+ 2.14.7.

You said earlier "I am running Toutou/Puppy 4.31, GTK+ version 2[.14.7] and a self compiled gtkdialog 0.8.1 from svn repository.", but we have just demonstrated that those error messages do not originate from Gtkdialog compiled on your computer.

If you see those error messages again then it's because you are executing a gtkdialog binary that was built against GTK+ >= 2.16.0 i.e. a prebuilt binary from a package, not your self compiled binary.

You should locate the gtkdialog binary on your computer that is causing those error messages and replace it with a fresh copy that you have compiled.

Regards,
Thunor

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#17 Post by Argolance »

Hello thunor,
You should locate the gtkdialog binary on your computer that is causing those error messages and replace it with a fresh copy that you have compiled.
It is what I did. Tried my own script converted as gtkdialog4 (renamed new original to gtkdialog4 and moved it to /usr/sbin/ instead of the 'old' one), replaced <visible> tags with <sensitive> inside my script and didn't get any errors messages. 8)

Thanks for your kind patience and attention.
Cordialement.

Post Reply