Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#286 Post by zigbert »

BarryK wrote:You are playing with words here......
I am speechless.

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

#287 Post by 8-bit »

BK,
I am not speechless.
You just got carried away as did the rest of us excited by the updates to gtkdialog and the possibilities it presented.
Everyone knew when thunor started updating gtkdialog, that it could be classified as an alpha or beta version.
This normally means that testing is required.
It is also why Puppy builds normally do not include applications or utilities in their development phase.
It is also a reason why we have an older version of GTK+.
A later version from what I have heard, breaks things Puppy.

No one told you you had to use a version of gtkdialog that is under development or any of the applications that make use of the new features.

So do not jump all over everyone when something does not work right.
It is no different that posting a beta/test ISO and asking for bug feedback.
That is what is being done with gtkdialog and you also have to remember that the changes to it are not solely for Puppy's benefit as other linux OSes also use it.

I now have said my piece and will return you to the normal forum.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#288 Post by BarryK »

Ok, I have implemented a solution. I certainly don't want to dampen thunor's enthusiasm. See blog post:

http://bkhome.org/blog/?viewDetailed=02455

It is easy enough for developers to call either 'gtkdialog', or test for 'gtkdialog4' and use that, so all the old scripts can carry on using 'gtkdialog3' and they will still work.
[url]https://bkhome.org/news/[/url]

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

#289 Post by 8-bit »

I have a problem with thunor's fileselect_widget example.
In the example, why can't I pass a selected directory from the folder entry to be used by the file entry?

I tried using the variable "ent3", but that did not work even though it contains the selected directory.

In other words, I am setting in /root/examples and I use directory to choose /root.
/root is now in the variable ent3.
But clicking on the file selection icon brings up the original directory /root/examples and not the selected one.

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

#290 Post by 8-bit »

This is the script I am using for insight into what I am trying to do.
In the original script "$HOME" works and is a global variable.
But replacing it with "$ent3" does not.
I think this goes along with Barry's comment of the latest gtkdialog breaking Pfind as passing the directory variable to the file button does not happen.

Evidently, what I am trying to do in this example of passing a variable from Fileselect-folder to Fileselect-File is not possible with the current gtk code it relies on. I have found information in searching the web that basically states that. So this one although no solved in it's present state is of no use and the app I was thinking about will have to be written from scratch.
EDIT: I need someone to show me what use Fileselect:directory is when I cannot pass the selected directory to either an internal variable or an outside file!
In other words, I need help understanding how this would work.

I am about to drop the whole thing as it currently is just an exercise to see if it can be done.

Code: Select all

#!/bin/sh

# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.
# Modified thunor's script trying to pass the directory variable to
#  the file button so it opens in the selected directory
GTKDIALOG=gtkdialog3    ##Using latest build of gtkdialog

function funcbtnCreate() {
   echo '<button>
         <input file stock="gtk-'$2'"></input>
         <action>fileselect:ent'$1'</action>
      </button>'
}
export ent1 ent3
export MAIN_DIALOG='
<window title="Fileselect" resizable="false" width-request="500">
   <vbox>
      <vbox border-width="20" spacing="10">
         <hbox>
            <text label="folder" width-request="80"></text>
            <entry fs-title="Select an existing folder" fs-action="folder">
               <variable>ent3</variable>
            </entry>
            '"$(funcbtnCreate 3 open)"'
         </hbox>
         <hseparator></hseparator>
         <hbox>
            <text label="file" width-request="80"></text>
            <entry fs-folder="'$ent3'" fs-action="file"
               fs-filters="c*|t*"
               fs-title="Select an existing file">
               <variable>ent1</variable>
            </entry>
            '"$(funcbtnCreate 1 new)"'
         </hbox>
      </vbox>
      <hseparator></hseparator>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG
Last edited by 8-bit on Sat 03 Sep 2011, 23:31, edited 2 times in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#291 Post by BarryK »

I have implemented the separation of PETs that require gtkdialog4 versus gtkdialog3:

http://bkhome.org/blog/?viewDetailed=02457
[url]https://bkhome.org/news/[/url]

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

#292 Post by 8-bit »

Post now gone. When will I actually learn to read before shooting my mouth off.
I must be getting senile.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#293 Post by 01micko »

Barry

It could be dangerous reverting to gtkdialog3, unless the Moose on the Loose bugfix is applied, fixes stdin. This is the reason we could get rid of gtkdialog2 as I understand.

Slacko will not ship with gtkdialog3 but a link to it (beta2 will ship with rev-254)

By the way Thunor, nice job with the examples. 8)
Puppy Linux Blog - contact me for access

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

#294 Post by thunor »

01micko wrote:By the way Thunor, nice job with the examples. 8)
Mick, you're welcome :)

I'm busily adding the missing widget references so there'll be a few more *_advanced examples appearing.

Regards,
Thunor

User avatar
frafa
Posts: 10
Joined: Thu 04 Aug 2011, 14:48
Location: MONTPELIER
Contact:

#295 Post by frafa »

@8-bit
Example:

Code: Select all

#!/bin/bash
function FCT_ACTIVATE_FILE()
{
if [ -d "$ent3" ]; then
echo -e '<action signal="show">enable:button1</action>
<action signal="show">enable:ent1</action>
<action signal="show">enable:text1</action>
<action signal="show">refresh:button1</action>
<action signal="show">refresh:ent1</action>
<action signal="show">refresh:text1</action>'
else
echo -e '<action signal="show">disable:button1</action>
<action signal="show">disable:ent1</action>
<action signal="show">disable:text1</action>
<action signal="show">refresh:button1</action>
<action signal="show">refresh:ent1</action>
<action signal="show">refresh:text1</action>'
fi
}

function FCT_MAIN_FILES()
{
GTKDIALOG=gtkdialog3
export MAIN_DIALOG='<window title="Fileselect" resizable="false" width-request="500">
<vbox>
<vbox border-width="20" spacing="10">
<hbox>
<text label="folder" width-request="80"></text>
<entry fs-folder="'$1'" fs-title="Select an existing folder" fs-action="folder">
<variable>ent3</variable>
<input>if [ -d "'$1'" ]; then echo '$1'; else echo "Please select folder!"; fi</input>
</entry>
<button>
<input file stock="gtk-open"></input>
<action>fileselect:ent3</action>
<action>exit:selfolder</action>
</button>
</hbox>
<hseparator></hseparator>
<hbox>
<text label="file" width-request="80">
<variable>text1</variable>
</text>
<entry fs-folder="'$1'" fs-action="file" fs-filters="c*|t*" fs-title="Select an existing file">
<variable>ent1</variable>
</entry>
<button>
<input file stock="gtk-new"></input>
<action>fileselect:ent1</action>
<variable>button1</variable>
</button>
</hbox>
</vbox>
<hseparator></hseparator>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
'$(FCT_ACTIVATE_FILE)'
<action signal="hide">exit:Exit</action>
</window>'
MAIN_DIALOG="$($GTKDIALOG --center --program=MAIN_DIALOG)"
eval $MAIN_DIALOG
}
i=0
while true 
do
if [ "$i" -gt "5" ]; then break; fi
if [[ ! "$ent1" || ! "$ent3" ]]; then
FCT_MAIN_FILES "$ent3"
else
break
fi
let i++
sleep .1
done
echo "file:$ent1 folder:$ent3"
exit 0
Last edited by frafa on Mon 05 Sep 2011, 12:49, edited 4 times in total.

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

#296 Post by jpeps »

thunor wrote:
01micko wrote:By the way Thunor, nice job with the examples. 8)
Mick, you're welcome :)

I'm busily adding the missing widget references so there'll be a few more *_advanced examples appearing.

Regards,
Thunor
I just love the timer.

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#297 Post by big_bass »

Hey thunor

I would like to thank you for stepping up to the plate and taking on the big task of updating, bug fixing, adding new features to gtkdialog for the linux community

and handling it all in a professional manner
using http://code.google.com/p/gtkdialog/

generally speaking when work is done in an organized documented way
users have the option to test new features and offer feedback with the aim to better the the code by taking part in the code development process

with an end goal of having a good program
to code small apps with

I always remind my self of a saying that I heard once
"if you stick your head above the crowd someone will throw a rock at you"
this isnt a problem you just have to learn to dodge it quickly
and go back to whatever you were doing



*I forget who said that its been a long time here was the quote*
funny that it was David Lee that said that
David Lee Roth quotes
You stick your head above the crowd and attract attention and
sometimes somebody will throw a rock at you. That's the territory.
You buy the land, you get the Indians.
Joe

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

#298 Post by 8-bit »

frafa,
I tried running your example a few times using the latest gtkdialog and had an error with the <sensitive> lines kicking me out.
When I remedied that, I had to kill it as it took up lots of processing power without ever displaying anything.

But thank you for thinking of me.

It is actually just a test.
(Variables stay populated by the way and I checked just before my fileselect action command by sending the variable to a temporary file.)

One is supposed to be able to pass a directory to fileselect for use with the file command. But there is something that is not happening of the variable passing it's content string when put into the entry that is passed to fileselect. The interesting thing here is that if you use a global variable, $HOME, that works. Maybe that means the variable has to be declared outside of the script.
I was up all night last night trying various things and So I may have pissed a few off as my mental state was not good.

For that, I sincerely Apologize to those I upset!


I WILL figure this out for myself or die trying.

All of you remember to bring flowers so you have something to pee on. :wink:

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

#299 Post by vovchik »

Dear thunor,

Just another word of thanks. I fully endorse Joe's (big_bass) views in the post above. You are doing wonders....so please slog away for the common good.

With thanks and kind regards,
vovchik

User avatar
frafa
Posts: 10
Joined: Thu 04 Aug 2011, 14:48
Location: MONTPELIER
Contact:

#300 Post by frafa »

@8-bit
Hum strange...

-i have edited and removed sensitive in exemple
<sensitive>false</sensitive>
and replaced by
<action signal="show">disable:...</action>
and
<action signal="show">enable:...</action>

-and added a safety loop "while true ..." stop if loop >= 5 to prevent your bug
may be retested ...

François

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

#301 Post by 8-bit »

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**.

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

#302 Post by disciple »

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?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

#303 Post by disciple »

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: Select all

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

Code: Select all

1
30
200
Because of this, in some apps people have implemented menu functions to sort and rebuild the treeview. This is not ideal ;)
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?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

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

#304 Post by 8-bit »

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: Select all

#!/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
			

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

#305 Post by disciple »

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: Select all

** ERROR **: gtkdialog: Error in line 10, near token '<hseparator>': Unknown tag.

aborting...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

Post Reply