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 24 Nov 2014, 01:33
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 21 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 19, 20, 21, 22, 23, ..., 53, 54, 55 Next
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Tue 06 Sep 2011, 00:25    Post subject:  

frafa,

Thank you, Thank you, Thank you.
I should mention that I only found one thing that evidently was messing with me running your example.
In your modified example in line 23 loaded in Geany, you had "GTKDIALOG=gtkdialog3"
For me, that meant I was trying to run it with the version of gtkdialog that comes with Puppy and nothing seemed to work.

I realized that upon examining your code change and changed the line to "GTKDIALOG=gtkdialog to use the newest version courtesy of thunor and everything then worked!

But to anyone that tries that script, be sure to use the latest version of gtkdialog or you may have to kill the script or restart x to recover.

I still have to look again at the code as it, for me is a learning experience.

Again, Thank you!

And while I am at it, I again want to thank thunor for all the work he has done and again, in case he did not get my latest post on the google code site, I again offer my sincerest apologies to him as I will admit, I must have been a real pain in the a**.
Back to top
View user's profile Send private message 
disciple

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

PostPosted: Sun 11 Sep 2011, 08:14    Post subject:  

Hi guys, are the tree widget selection modes working correctly? When I run the tree_selection_mode example with latest svn the "browse" and "single" modes seem to be the same. This surprised me, as I would have thought it was something you'd just pass straight on to GTK.

BTW the list selection modes also don't behave quite as I'd expect. Try running the list example, click on the first list item, drag, and release on the second list item. Then click on the second item, drag, and release on the third item. It always selects (or unselects) the item you click on, even if you don't release on it. Is this behaviour correct?

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

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

PostPosted: Sun 11 Sep 2011, 08:29    Post subject:  

I've remembered something that I think isn't possible currently, and would be a big enhancement. Currently, I don't think there is any way of defining the type of data in a treeview column, or how it should be sorted when you click on the column header. e.g. if you have a column of file sizes, they would sort like this:
Code:
1
200
30

but you would actually want to sort them like this:
Code:
1
30
200

Because of this, in some apps people have implemented menu functions to sort and rebuild the treeview. This is not ideal Wink
Firstly, does anyone know if I am wrong? Is there already a way to control how a column is sorted?
If not, do you think it would be feasible to implement it?

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


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Sat 17 Sep 2011, 20:53    Post subject:  

thunor has been busy in the background.

I cut down part of one of the new text examples and saved it as /root/angles.sh

I thought it was interesting so this is it if you want to try it.
Again, it may take the latest version of gtkdialog.
EDIT: I stand corrected. It runs fine with the original gtkdialog3.
Code:

#!/bin/sh

GTKDIALOG=gtkdialog

export MAIN_DIALOG='
<vbox>
   <hbox border-width="30" spacing="30">
      <vbox>
         <text wrap="false" angle="45">
            <label>"Angled text (line wrapping must
    be disabled for this) and any
        angle is supported."</label>
         </text>
      </vbox>
   </hbox>
   <hseparator></hseparator>
   <hbox homogeneous="true">
      <button use-stock="true" label="gtk-ok" has-focus="true"></button>
   </hbox>
</vbox>
'

$GTKDIALOG --program=MAIN_DIALOG
         
Back to top
View user's profile Send private message 
disciple

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

PostPosted: Sat 17 Sep 2011, 22:45    Post subject:  

Quote:
EDIT: I stand corrected. It runs fine with the original gtkdialog3.

Well, the angled text does, but your example doesn't, because of the hseparator.
Code:
** ERROR **: gtkdialog: Error in line 10, near token '<hseparator>': Unknown tag.

aborting...

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


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Sat 17 Sep 2011, 22:58    Post subject:  

Just thought I'd share my script for updating gtkdialog from svn. It packs up the pets in $HOME, you can adjust it to get rid of the symlink to gtkdialog3 if you wish. Be aware that you must have already downloaded and compiled the first time.
Code:
#!/bin/sh
#my script to update and package gtkdialog
[ -x src/gtkdialog ] && make clean
svn update
./autogen.sh && make
echo
echo "scroll up to get the svn version number"
echo -en "\033[0;31m""enter version";echo -e "\033[0m"
read VER
cd src
strip --strip-unneeded gtkdialog
mkdir -p $HOME/gtkdialog4-${VER}-s/usr/sbin
cp -af gtkdialog $HOME/gtkdialog4-${VER}-s/usr/sbin
cd $HOME/gtkdialog4-${VER}-s/usr/sbin
ln -s gtkdialog gtkdialog3
ln -s gtkdialog gtkdialog4
cd -
pwd
cd ..
mkdir -p $HOME/gtkdialog4_DOC-${VER}-s/usr/share/doc/gtkdialog/examples
cp -arf examples/* $HOME/gtkdialog4_DOC-${VER}-s/usr/share/doc/gtkdialog/examples/
rm -f $HOME/gtkdialog4_DOC-${VER}-s/usr/share/doc/gtkdialog/examples/Make*
cd $HOME
dir2pet gtkdialog4-${VER}-s
dir2pet gtkdialog4_DOC-${VER}-s
echo done && exit 0


You should remove the -s suffix too, I do it for slacko packaging

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Sun 18 Sep 2011, 00:21    Post subject:  

Micko
Quote:
Be aware that you must have already downloaded and compiled the first time.


well seeing that you did the update heres the first step

I just modified your snippet for getting the first package and used /tmp

I left it at the" folder level" because from there I package using slackwares format (I left that part out for pet users )
but anyone else could package the pet from there


Updated to add a compile date to have a reference
with the ongoing development


Code:

#!/bin/sh

svn checkout http://gtkdialog.googlecode.com/svn/trunk/ /tmp/gtkdialog-read-only
cd /tmp/gtkdialog-read-only
./autogen.sh
make
cd src
strip --strip-unneeded gtkdialog

mkdir -p /tmp/gtkdialog4/usr/sbin
cp -af gtkdialog /tmp/gtkdialog4/usr/sbin
cd /tmp/gtkdialog4/usr/sbin
ln -s gtkdialog gtkdialog3
ln -s gtkdialog gtkdialog4

mkdir -p /tmp/gtkdialog4_DOC/usr/share/doc/gtkdialog/examples
 
cp -arf /tmp/gtkdialog-read-only/examples/* /tmp/gtkdialog4_DOC/usr/share/doc/gtkdialog/examples/


# add when compiled info
MODDATE=$(stat -c %y /tmp/gtkdialog4/usr/sbin/gtkdialog)
MODDATE=${MODDATE%% *}
echo "compiled this day" $MODDATE > /tmp/gtkdialog4_DOC/usr/share/doc/gtkdialog/date_compiled.txt




_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though

Last edited by big_bass on Sun 18 Sep 2011, 10:25; edited 1 time in total
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Sun 18 Sep 2011, 03:01    Post subject:
Subject description: Keeping Current
 

Well, I now have seen 01micko's script, and big_bass's script, so I guess I will show you mine even though it is very simplistic. Also, I guess one could think it dangerous in that it does not allow for alerting one of compile errors. I am unsure if the script would be interrupted if a compiling error occurred.
I used another to initially download the source to /root/gtkdialog.
I then put this script which I called Keep_Current in the /root/gtkdialog directory.

Code:

#!/bin/bash
svn update
make clean
./autogen.sh
make
 cd src
 strip gtkdialog
cp -af gtkdialog /usr/sbin
   `xmessage -name 'Gtkdialog Update' -center -bg orange -fg black " Update of Gtkdialog3 completed."`


But I was thinking, yeah I know that is dangerous, about uses for the type of code in the example I posted.
If one set the angle to either 90 or 180, it seems that it would display foreign, I forget if it is Chinese or Japanese characters that normally are printed Top to Bottom, Left to Right?
Anyway, it seems it could be used to display that text in the form in which it would normally be printed. The one thing I did not allow for is that the characters would have to be also rotated so that they would not display on their side.
Or am I shooting in the dark here?

Some of the new examples in the gtkdialog/examples directory are interesting as they bring up things I did not know about.
And the examples are still being updated.
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Mon 19 Sep 2011, 13:15    Post subject:
Subject description: 2 links
 

01micko,
Why are you making the system link:
ln -s gtkdialog gtkdialog3

It seems to me that this would overwrite the original gtkdialog3 and in the process, defeat the idea of having two separate versions so as not to break some existing puppy scripts?
I am not complaining here, just noting that you have two links to the same updated gtkdialog file.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Mon 19 Sep 2011, 16:31    Post subject:
Subject description: 2 links
 

8-bit wrote:
01micko,
Why are you making the system link:
ln -s gtkdialog gtkdialog3

It seems to me that this would overwrite the original gtkdialog3 and in the process, defeat the idea of having two separate versions so as not to break some existing puppy scripts?
I am not complaining here, just noting that you have two links to the same updated gtkdialog file.


I am refusing to use gtkdialog3 pets in Slacko (as in the old gtkdialog3 executable Wink ), I figure, fix what's broken in the older apps. In the end, everyone's code will be better Smile

I will make one point, piping to stdout is broken in gtkdialog3. The Moose On the Loose patch fixes it and is incorporated in thunor's revisions. As you know I spearheaded a campaign to get rid of gtkdialog2, this was the catalyst, as that's the main reason gtkdialog2 was kept in, so those ancient apps need gtkdialog4. Confused yet! (I am) Laughing

I wrote:
you can adjust it to get rid of the symlink to gtkdialog3 if you wish


Cheers!

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
pemasu


Joined: 08 Jul 2009
Posts: 5465
Location: Finland

PostPosted: Mon 19 Sep 2011, 17:05    Post subject:  

I have followed 01mickos route with gtkdialog. Better recognize what needs fixing than burying it. I have created same symlinks as 01micko.
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Mon 19 Sep 2011, 17:25    Post subject:  

Well, I understand your explanation.
If I knew what applications are effected by just using the newest gtkdialog, and what is needed to make them work, I would go your route.
But for now, I have /usr/sbin/gtkdialog gtkdialog3 and a system link of gtkdialog4 pointing to gtkdialog.
I did not use a PET to install them. Rather, I did it directly.

I had found though that what I thought was an original gtkdialog3 file had in fact been modified by me before I reverted by not copying the compiled gtkdialog to /usr/sbin/gtkdialog3.
I went back and mounted an SFS with the original gtkdialog3 file and copied it over.

But till this all gets figured out as to what scripts are effected, I will remain with my present setup.

Thank you again for the explanation though.
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: Tue 20 Sep 2011, 11:55    Post subject:  

Added colorbutton widget

The widget reference is available here.

  • Use the "use-alpha" tag attribute to manage changing the alpha too (it's false by default)
  • The widget's variable will contain e.g. "#4488cc" without alpha, "#4488cc|32767" with alpha
  • The default signal is "color-set", emitted when the user selects a colour

frafa requested GtkColorSelection (GtkColorSelectionDialog as a widget) and I saw a recent Gtkdialog application (JWM Theme Maker) that uses a colour selection dialog from Xdialog so I decided to add this now as opposed to leaving it till the next development period.

GTK+ uses16bit colour components i.e. #rrrrggggbbbb (the dialog shows #rrggbb) but Gtkdialog expects it to be input and outputs it using the more useful #rrggbb.

GTK+ uses16bit alpha 0-65535 (the dialog shows 8bit 0-255) but Gtkdialog has to use 16bit because the GTK+ property "alpha" expects 0-65535.

You don't have to use the "alpha" GTK+ property though, you can pass it in via the e.g. <default>#4488cc|32767<default>, <input> or <input file> directives but it won't have an effect unless you've set the tag attribute use-alpha="true".

Since I found hardly anything on the net about converting between these formats, I worked it out in the end (#4488cc == #44448888cccc, 127 (0x7f) == 32639 (0x7f7f), so you can convert the alpha like this (integer arithmetic):

8bit_alpha * 257 = 16bit_alpha
(16bit_alpha + 257 / 2) / 257 = 8bit_alpha

[EDIT] I'll expand on this so there's an example: suppose you chose the colour #99bfac and an alpha of 173 -- the widget's variable would contain "#99bfac|44461" -- so once you've isolated the alpha you can convert it like this (I've printed it in hex so you can see how the 16bit alpha value is constructed:
Code:
[root@ese:trunk]# echo $(( (44461 + 257 / 2) / 257 ))
173
[root@ese:trunk]# echo $(( 173 * 257 ))
44461
[root@ese:trunk]# printf "%04x\n" 44461
adad

This example has been committed to SVN so you'll already have it if you've updated recently.

<colorbutton> widget example:
Code:
#!/bin/sh

GTKDIALOG=gtkdialog

export TMPDIR=/tmp/gtkdialog/examples/"$(basename $0)"
mkdir -p "$TMPDIR"

funcbtnCreate() {
   echo '<button>
         <label>'"$2"'</label>
         <input file stock="'$3'"></input>
         <action>echo "'"$4"' '$1'"</action>
         <action type="'"$2"'">'$1'</action>
      </button>'
}

funcclbCreate() {
   echo '<variable>'$1'</variable>
         <action>echo '$1' changed to $'$1'</action>
      </colorbutton>
      <entry editable="false" width-request="360">
         <default>'$2'</default>
      </entry>
   </hbox>'
   if [ $3 = 1 ]; then
      echo '<hseparator></hseparator>
         <hbox>'
   fi
}

echo " #44cc88 | 16384 " > "$TMPDIR"/inputfile

export MAIN_DIALOG='
<window title="ColorButton Advanced" resizable="false">
   <vbox>
      <vbox border-width="30">
         <hbox>
            <colorbutton>
               '"$(funcclbCreate clb0 "All defaults." 1)"'
            <colorbutton title="Choose something asthetically pleasing">
               <default>#cc4488</default>
               '"$(funcclbCreate clb1 "Colour from default directive, title from tag attribute." 1)"'
            <colorbutton use-alpha="true" alpha="49152">
               <default>#88cc44</default>
               '"$(funcclbCreate clb2 "Colour from default directive, alpha from tag attribute." 1)"'
            <colorbutton use-alpha="true">
               <default>#4488cc|32768</default>
               '"$(funcclbCreate clb3 "Colour and alpha from default directive." 1)"'
            <colorbutton>
               <input>echo "#cc8844"</input>
               '"$(funcclbCreate clb4 "Colour from input directive." 1)"'
            <colorbutton use-alpha="true">
               <input file>'"$TMPDIR"'/inputfile</input>
               <output file>'"$TMPDIR"'/outputfile</output>
               '"$(funcclbCreate clb5 "Colour and alpha from input file directive." 0)"'
      <hbox>
         '"$(funcbtnCreate clb5 Disable gtk-no Disabling)"'
         '"$(funcbtnCreate clb5 Enable gtk-yes Enabling)"'
         '"$(funcbtnCreate clb5 Refresh gtk-refresh Refreshing)"'
         '"$(funcbtnCreate clb5 Save gtk-save Saving)"'
      </hbox>
      </vbox>
      <hseparator></hseparator>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Fri 23 Sep 2011, 04:52; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1287
Location: Ukraine

PostPosted: Tue 20 Sep 2011, 12:39    Post subject:  

Dear thunor,

Thanks for the colorselect function. Brilliant!

With kind regards,
vovchik

PS. Would fontselect be too much to ask for?
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: Tue 20 Sep 2011, 12:46    Post subject:  

disciple wrote:
Hi guys, are the tree widget selection modes working correctly? When I run the tree_selection_mode example with latest svn the "browse" and "single" modes seem to be the same. This surprised me, as I would have thought it was something you'd just pass straight on to GTK.

BTW the list selection modes also don't behave quite as I'd expect. Try running the list example, click on the first list item, drag, and release on the second list item. Then click on the second item, drag, and release on the third item. It always selects (or unselects) the item you click on, even if you don't release on it. Is this behaviour correct?

The tree widget selection modes are working for me (I've just tried using r293). In Single mode you can deselect, in Browse mode you can't.

The list widget is created using gtk_list_new(), put in a scrolledwindow and that's it. Try the list_advanced example which I created to explore the widget's capabilites so that I could document it.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 21 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 19, 20, 21, 22, 23, ..., 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.1355s ][ Queries: 12 (0.0128s) ][ GZIP on ]