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 Mon 01 Sep 2014, 20:06
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 28 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 26, 27, 28, 29, 30, ..., 53, 54, 55 Next
Author Message
thunor


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

PostPosted: Fri 18 Nov 2011, 10:46    Post subject:
Subject description: Window and taskbar icon
 

vovchik wrote:
Dear thunor,

Would it be possible to add the following:
Code:
gtk_window_set_icon_from_file(long,char*,void*)

to the window code so as to allow for user-defined pixmaps as window/taskbar icons? I have used that gtk call in progs in C and Bacon myself, so I know it is a cinch. All that is needed, apart from the imported function, is an appropriate tag_attr, which, along side the existing icon-name="gtk-xxxx" could be something like pixmap="path to img". Any thoughts?

With kind regards,
vovchik

I've created a feature request for it Smile

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


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

PostPosted: Mon 28 Nov 2011, 05:52    Post subject:  

Hello Thunor,
This is what I noticed while testing/working with latest scripts given as examples 'v/hscale_advanced' from svn repository.

Wary 5.2.2 - gtk 2 24 8 - gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor. Could not compile gtkdialog version 0.8.1 from svn repository.
Console:
Quote:
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:64: error: duplicate member 'GSEAL'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:65: error: duplicate member 'GSEAL'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:65: error: duplicate member '({anonymous})'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:67: error: duplicate member 'GSEAL'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:67: error: duplicate member '({anonymous})'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:67: error: duplicate member '({anonymous})'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:68: error: duplicate member 'GSEAL'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:68: error: duplicate member '({anonymous})'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:68: error: duplicate member '({anonymous})'
/usr/include/gtk-2.0/gtk/gtkinputdialog.h:68: error: duplicate member '({anonymous})'
make[3]: *** [gtkdialog.o] Error 1
make[3]: Leaving directory `/root/gtkdialog/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/gtkdialog/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/gtkdialog'
make: *** [all] Error 2

    - Floating point value=point (example: 0.20) works with en locale, doesn't work when=comma (example: 0,20)
    - Floating point value=point (example: 0.20) doesn't work with es, de, es locales, works when=comma (example: 0,20)


Just for info (... looking at what you explained about my previous-solved problem, I well understand that this is 'normal'l) Smile
Puppy 431 - gtk 2 14 7 - gtkdialog version 0.8.1 (C) 2003-2007 Laszlo Pere, 2011 Thunor (self compiled from svn repository: november 21)
    - Floating point value=point (example: 0.20) doesn't work with en, es, de, fr locales.

Console:
Quote:
(gtkdialog:26888): Gtk-CRITICAL **: IA__gtk_hscale_new_with_range: assertion `step != 0.0' failed

(gtkdialog:26888): Gtk-CRITICAL **: IA__gtk_range_set_value: assertion `GTK_IS_RANGE (range)' failed
**
ERROR:variables.c:113:variables_new_with_widget: assertion failed: (widget != NULL)
/root/gtkdialog/examples/hscale/hscale_advanced_point: line 103: 26888 Aborted
$GTKDIALOG --program=MAIN_DIALOG
Script completed hit RETURN to close window.

    - Floating point value=comma (example: 0,20) works with en, es, de, fr locales.

I am tearing my hair!
Any idea?

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: Tue 29 Nov 2011, 11:13    Post subject:  

Argolance wrote:
I am tearing my hair!
Any idea?

Regards.

Hi Argolance

I'm overloaded with things to do in my life. It looks like your GTK+ headers need looking at so you should focus your attention on that. "GSEAL" is not in Gtkdialog anywhere.

Just give me a very simple Gtkdialog example of what you want to do in your native locale and if it errors then show me the output.

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


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

PostPosted: Tue 29 Nov 2011, 13:31    Post subject:  

Hello thunor,
Quote:
I'm overloaded with things to do in my life.

I read that somewhere on a thread... Sorry to stole a bit of your precious time. Good luck and success for what you are doing and thank you very much for your kind attention...

While running the script below with Wary 5.2.2 - gtk 2 24 8 - gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor. Fresh install out of the box (live cd + save.3fs file)
Code:
#!/bin/sh

GTKDIALOG=gtkdialog

export MAIN_DIALOG="
<window title=\" HScale comma test \" resizable=\"false\">
   <vbox>
         <frame hscale widget>
            <hscale value-pos=\"0\" space-expand=\"true\" space-fill=\"true\" width-request=\"200\" height-request=\"20\" range-min=\"0,0\" range-max=\"30,0\" range-step=\"0,1\" range-value=\"15,0\">
            <variable>VARIABLE</variable>
            </hscale>
         </frame>
      <hbox homogeneous=\"true\">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal=\"hide\">exit:Exit</action>
</window>
"

case $1 in
   -d | --dump) echo "$MAIN_DIALOG" ;;
   *) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
    - Floating value=point (example: 0.1) works when Puppy is configured for en locales countries (en_US, en_GB...), doesn't work when floating value=comma (example: 0,1... see error message above in my previous post)
    - Floating value=point (example: 0.1) doesn't work when Puppy is configured for locales fr, es, de, es (fr_CA, es_ES... see error message above in my previous post), works when floating value=comma (example: 0,1)

And vice-versa with this same script where points (.) are replaced with commas (,): (example: 0,1)
Code:
#!/bin/sh

GTKDIALOG=gtkdialog

export MAIN_DIALOG="
<window title=\" HScale point test \" resizable=\"false\">
   <vbox>
         <frame hscale widget>
            <hscale value-pos=\"0\" space-expand=\"true\" space-fill=\"true\" width-request=\"200\" height-request=\"20\" range-min=\"0.0\" range-max=\"30.0\" range-step=\"0.1\" range-value=\"15,0\">
            <variable>VARIABLE</variable>
            </hscale>
         </frame>
      <hbox homogeneous=\"true\">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal=\"hide\">exit:Exit</action>
</window>
"

case $1 in
   -d | --dump) echo "$MAIN_DIALOG" ;;
   *) $GTKDIALOG --program=MAIN_DIALOG ;;
esac

More: Could not compile gtkdialog version 0.8.1 from svn repository, devx_wary_5.2.2.sfs installed.: See error message in my previous post.

Hope this is clear!

Best 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: Tue 29 Nov 2011, 17:57    Post subject:  

I asked Francois to test it on his Ubuntu computer.

I then thought why don't I change my lupu-520 system to French so I did that and it worked fine.

So, can you compile gtkdialog-0.8.0 on your computer? Download the source package and try it. All I've done between 0.8.0 and 0.8.1 is to remove a dodgy strlen() call from the XML-from-envar loading routine and update some examples. Nothing else.
argolance-hscale-comma-issue.png
 Description   HScale works in French using comma delimiters on lupu-520
 Filesize   35.2 KB
 Viewed   917 Time(s)

argolance-hscale-comma-issue.png

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


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

PostPosted: Tue 29 Nov 2011, 18:28    Post subject:  

Hello,
Quote:
HScale works in French using comma delimiters on lupu-520
... Yes, and with Wary too! Here is not the problem I tried to explain above. This script using comma doesn't work in English (setup country locale en_US for example)... unless replacing commas to points.
Inversly, HScale using point delimiters works fine in English but not in French (setup country locale fr_FR). The same in es, de, etc...
Quote:
I then thought why don't I change my lupu-520 system to French so I did that and it worked fine.
But did you simply try this "comma" script with English en_* locale?

I have got this problem with too different PCs running Wary 5.2.2... and pemasu, who tested my scripts (using the same hscale code!) encountered this issue to!

Best 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: Tue 29 Nov 2011, 18:31    Post subject:  

I got a reply from Francois:
Quote:
For me your code are ok
extract of my export cmd:
declare -x LANG="fr_FR.UTF-8"
declare -x LANGUAGE="fr_FR:en"

tested on Ubuntu 11.04 32bits
and gtkdialog version 0.8.0 (C) 2003-2007 Laszlo Pere, 2011 Thunor

I think that you should get another French user with the same distribution as you to test your example. Also try another locale that uses commas. I'm guessing that your GTK+ is unwell and it might be a good idea to post this problem in a wary 5.2.2 thread, perhaps this one.

Good luck,
Thunor
hscale.gif
 Description   
 Filesize   61.4 KB
 Viewed   912 Time(s)

hscale.gif

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: Tue 29 Nov 2011, 18:51    Post subject:  

Ok sorry, I misunderstood what you are explaining.

I see now. It shouldn't matter if it's written with decimal points or decimal commas, it should just work across any locales without modification.

I need to do some tests on the Gtkdialog code.

I'll have a look tomorrow.

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


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

PostPosted: Tue 29 Nov 2011, 19:02    Post subject:  

Hello,
Thank you! Great animated gif!
Quote:
and it might be a good idea to post this problem in a wary 5.2.2 thread, perhaps this one.
This is what I did at the same time I sent my previous post in this one...

It's time for me to go to bed now... Wink

Regards

_________________

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


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

PostPosted: Tue 29 Nov 2011, 19:12    Post subject:  

Hello,
I discovered your latest post after sending mine!
Quote:
Ok sorry, I misunderstood what you are explaining.
I guess my explanations were probably not very clear: I sincerely tried though! Sorry! Pleased that you finally understood what is the issue.

"See" you soon!

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: Tue 29 Nov 2011, 20:04    Post subject:  

I just had to have a look Very Happy

I understand now what I need to do: The C functions cannot be expected to extract doubles from strings that could contain either separators in any locale. The string needs to match the locale. Therefore if you want portable Gtkdialog pseudo-XML then I'm going to have to convert the separators within the strings to match the locale! Blimey...

Bed time (and think time)...
Back to top
View user's profile Send private message Visit poster's website 
Argolance


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

PostPosted: Wed 30 Nov 2011, 07:22    Post subject:  

Hello,
@ thunor
Did you sleep with one eye opened or like a log?
Quote:
I understand now what I need to do

Very Happy
For a long time, I noticed something else which has perhaps (in)directly something to do with the issue related above and concerning the latest release of JWM. In my xerrs.log, I am always getting these errors lines:
Quote:
JWM: warning: invalid tray opacity: 0.8
JWM: warning: invalid menu opacity: 0.8

Tray and menu opacity did not work properly anymore!

Wink Bed time (and think time)... I then thought why don't I replace points of the opacity values with commas in the /root/.jwm/jwmrc-theme?
So I did that.
And it worked fine! Very Happy Very Happy
Code:
. <TrayStyle>

   <Background>#777777</Background>

   <Opacity>0,5</Opacity>

</TrayStyle>


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: Wed 30 Nov 2011, 08:00    Post subject:  

I've had a good think about this now.

The problem is that the C functions such as atof() and strtod() will be expecting the correct decimal separator for the user's locale, but the application will have been written using any locale which is unknown.

There are two ways I can currently think of to deal with this:

1. Pass the XML's locale as an option to gtkdialog on the command-line e.g. gtkdialog --source-locale=fr_FR -p MAIN_DIALOG. I've identified about 16 places within Gtkdialog's C code that will require modification for this, and I'll also need to add the code to support the "--source-locale" option. Is there a problem with this method? Well, there are a multitude of LC_* variables affecting localisation and I'm not realistically going to be able to support all those on the command-line. Also this doesn't deal with what the application developer is doing outside of Gtkdialog i.e. reading and writing files with decimal separators or using commands that output decimal separators.

2. Deal with this in the application script. The application developer reads LC_NUMERIC, LC_ALL and/or LANG and then decides which decimal separator to use within the script. So instead of hardcoding "0,1" in your XML you would instead set DS="," and then use "0${DS}1". If you the developer are reading and writing files and using commands that include decimal separators then you should be writing your application to deal with the user's locale.

Now, you might expect me to prefer method 2 as then I don't have to do any work Razz But if you think about it, the XML/script and the developer's brain must operate in the user's locale, not expect the user's C library, executables and shell to be adjusted to deal with your script.

Let me know what you think or infact anyone who has an opinion on the matter.

Regards,
Thunor
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: Wed 30 Nov 2011, 08:31    Post subject:  

Hi Argolance

I think we're posting at the same time again Smile I've only just noticed that you posted before me.

I like to have a problem to sleep on. My head hits the pillow, I think how I'm going to solve the problem, I find a solution, and then I'm asleep Razz

So then, using your opacity issue as an example, if the value within jwmrc-theme was modified using the wrong decimal separator by some Gtkdialog application then the application developer should make sure that he is using the correct decimal separator for the user's locale.

[EDIT] Since Puppy Linux is built so much from Gtkdialog apps, I'm sure that other folk have already trodden this path. It might be new for us to think about but I'm certain somebody has already dealt with this before.

Regards,
Thunor
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: Wed 30 Nov 2011, 15:14    Post subject:  

This is how you could approach it:
Code:
#!/bin/sh

GTKDIALOG=gtkdialog

funcDecimalMarkGet() {
   local language

   ## LC_ALL takes precedence over LC_NUMERIC
   ## and if both are null then use LANG.
   language=$LC_ALL
   if [ -z "$language" ]; then language=$LC_NUMERIC; fi
   if [ -z "$language" ]; then language=$LANG; fi

   ## language[_territory][.codeset][@modifier]
   language=${language%@*}
   language=${language%.*}
   language=${language%_*}
   language=`echo $language | tr A-Z a-z`

   ## This'll do for a start.
   case "$language" in
      en | jp | cn ) echo '.' ;;
      *) echo ',' ;;
   esac
}

DM=`funcDecimalMarkGet`

MAIN_DIALOG='
<window title="Decimal Mark Test" resizable="true">
   <vbox>
      <frame hscale widget>
         <hscale space-expand="true" space-fill="true"
            width-request="200" height-request="20"
            value-pos="0"
            range-min="0'$DM'3" range-max="30'$DM'7"
            range-step="0'$DM'1" range-value="15'$DM'5">
            <variable>HSCALE</variable>
         </hscale>
      </frame>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

export DM
export MAIN_DIALOG

$GTKDIALOG --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Wed 30 Nov 2011, 18:49; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 28 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 26, 27, 28, 29, 30, ..., 53, 54, 55 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1305s ][ Queries: 13 (0.0147s) ][ GZIP on ]