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 Thu 17 Apr 2014, 19:58
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Problem converting gtkdialog3 script to gtkdialog4 (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sat 05 Nov 2011, 09:44    Post subject:  Problem converting gtkdialog3 script to gtkdialog4 (Solved)  

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:
Quote:
(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, 12:20; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sun 06 Nov 2011, 08:35    Post subject:  

Hello,
I found the same error message while testing this script inside the gtkdialog svn repository (gtkdialog-read-only/examples/progressbar/progressbar_test):
Quote:
#!/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? Crying or Very sad

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3276
Location: Oregon

PostPosted: Sun 06 Nov 2011, 10:13    Post subject:  

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.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Sun 06 Nov 2011, 10:31    Post subject:  

Hello 8-bit,
Thanks for replying!
Quote:
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?
Quote:
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! Crying or Very sad

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3219

PostPosted: Sun 06 Nov 2011, 12:04    Post subject:  

Looks like something in the refresh command:
Code:
 
<actiontype="refresh">ENTRY</action>


edit: you can update the date from another button in MAIN:

Code:

<button>
<label>REFRESH</label>
<action>refresh:ENTRY</action>
</button>
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3276
Location: Oregon

PostPosted: Sun 06 Nov 2011, 16:10    Post subject:  

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.
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6378
Location: Auckland, New Zealand

PostPosted: Sun 06 Nov 2011, 18:29    Post subject:  

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.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sun 06 Nov 2011, 19:29    Post subject: Re: gtkdialog3 script into gtkdialog4 problem...  

Argolance wrote:
...
Quote:
(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
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Mon 07 Nov 2011, 07:56    Post subject:  

Hello,
Thanks for replying.
Quote:
So the only problem is that you are seeing these messages?
This seems to be...
Quote:
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.

_________________

Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 07 Nov 2011, 09:13    Post subject:  

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/source/browse/trunk/src/widgets.c#797
http://code.google.com/p/gtkdialog/source/browse/trunk/src/widget_spinbutton.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:
#!/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
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Tue 08 Nov 2011, 06:58    Post subject:  

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

Yes, I would like! Very Happy
Quote:
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... Embarassed

Regards.

_________________

Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Thu 10 Nov 2011, 07:09    Post subject:  

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 Confused

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:
#!/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
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 11 Nov 2011, 07:04    Post subject:  

Hello Thunor,
Don't know exactly what's' happening under-the-hood but I strictly and stupidly did what you say. Embarassed
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?
Quote:
[...]
/* Defines */
//#define DEBUG_CONTENT
define DEBUG_TRANSITS
[...]

At last when I ran the script in console, I got:
Quote:
/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.
terminal.tar
Description 
tar

 Download 
Filename  terminal.tar 
Filesize  23.5 KB 
Downloaded  121 Time(s) 

_________________

Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Fri 11 Nov 2011, 08:53    Post subject:  

Argolance wrote:
...
Quote:
[...]
/* Defines */
//#define DEBUG_CONTENT
define DEBUG_TRANSITS
[...]

...

It should be
Code:
/* Defines */
//#define DEBUG_CONTENT
#define DEBUG_TRANSITS

Type make again and then run the script I gave you and show me the output Smile

Thanks,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1776
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Fri 11 Nov 2011, 10:22    Post subject:  

Hello Thunor,
Quote:
It should be
I said 'stupidly'... Embarassed
So, this time all ran as well as possible! Very Happy. No error.
Output is :
Code:
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.

_________________

Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 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.0951s ][ Queries: 12 (0.0064s) ][ GZIP on ]