Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#341 Post by thunor »

Mick

The gtkdialog-0.8.0 source package is r306 and is for the masses.

You and many people here are checking-out from SVN and you can continue to do that.

I have committed r307 which is a simple version change to 0.8.1 and I did this so that I can reserve even numbers for official source package releases.

[EDIT] I should mention too that the wiki is in the repository and working on that will up the revision. When checking out, if you type "svn log -r n" you'll see the commit message (editing wiki pages through the browser results in a default message containing a line of dashes, otherwise it'll be something I've written).

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

#342 Post by thunor »

I'm an application developer now 8)

This might be a top tip: I'm using functions in my script to build the XML and I'm creating a game board of varying sizes. Initially I started with an 8x8 board which took 2.5 seconds to appear and when I increased it to 12x12 it took 10.5 seconds! 15x15 jumped to 24 seconds!!! Obviously I'm not going to put anyone through that experience so I thought I'd investigate why it was taking so long. I found that building the XML in a shell variable was the cause and simply echoing the XML to a file and using "gtkdialog --file=filename" instead results in 8x8 loading in about 1s, 12x12 in 1.25s and 15x15 in 1.75s. It really makes that much difference so I recommend trying it.

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

#343 Post by frafa »

Yes Thunor kiss smack and more :)
Thank's for gtkdialog --file=filename !!!

for 256 img time load responds
Normal: user 0m2.848s
XML version: user 0m0.712s

Image

Download example: http://liveusb.info/tmp/colorchooser.tar.bz2
1° test ./ColorPicKer.sh
2° test ./ColorPicKe-xml.sh
:)
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#344 Post by thunor »

Hi frafa

Firstly I had to change ColorPicKe-xml.sh:22 to "gtkdialog --file=ColorPicKe-xml.sh" and then I ran your applications:

PIII 866 MHz

ColorPicKer.sh = 0m25.65s :shock:
ColorPicKe-xml.sh = 0m1.07s

That's a nice application :) You should change

Code: Select all

widget "*Button" style "styleBorderless"
to

Code: Select all

widget "*borderless" style "styleBorderless"
and then in generate.sh:63 add name="borderless" to the button tag because you are applying styleBorderless to all GtkButtons (look at Quitter, it has no border).

Regards,
Thunor
Last edited by thunor on Fri 30 Sep 2011, 11:46, edited 1 time in total.
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#345 Post by 8-bit »

I also have to say a big thank you. The release is very well documented and the inclusion of the Reference directory also helps along with the examples one.
User avatar
frafa
Posts: 10
Joined: Thu 04 Aug 2011, 14:48
Location: MONTPELIER
Contact:

#346 Post by frafa »

Ok modified :)
it's just an example, same adress download ...
if you modify generate.sh
erase all files and folder without generate.sh
run generate.sh all files/folder are regenerate
sorry for my broken English
François

EDIT: must be installed imagemagick to use generate.sh ...
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#347 Post by thunor »

thunor wrote:MAXWIDGETS

...when I was working on the widget packing I noticed that the maximum number of widgets Gtkdialog accepted was 256 (16^) so I've increased it to 529 (23^)....
I've since realised that MAXWIDGETS is a limit placed upon a container (vbox, hbox, frame), not the entire project, so you can currently have 529 widgets per container which isn't so bad.

The project limit I've just discovered is 2048.

This is just for the record so that everyone is aware of this.

Regards,
Thunor
User avatar
Dougal
Posts: 2502
Joined: Wed 19 Oct 2005, 13:06
Location: Hell more grotesque than any medieval woodcut

#348 Post by Dougal »

Thunor,
I just finished catching up on this thread and it's great what you've done, really excellent work both the features and documentation -- I see you've also added the html docs, which I thought of suggesting (I hope you deleted the old texinfo stuff...).

I do have one nitpick, though: your examples are really good and detailed, but have one problem: readability.
Since you use functions to auto-generate the pseudo-XML code, when an example is run it is not possible to look at the bit of code that produces a certain widget (and copy-paste it...), which I consider to be one of the main points of the examples.

I see two ways to change this:
- just put the static code in the scripts
- make the example scripts support a -d/--dump switch, which will only require a small change from

Code: Select all

$GTKDIALOG --program=MAIN_DIALOG 
to

Code: Select all

case $1 in
-d|--dump) echo "MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac
Other than that, I'll have to wait until the next time I use gtkdialog (and learn all the new widgets...) to see if I have any more suggestions... (but if you get bored and aren't listening to Hell, JWM needs some love!)
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#349 Post by vovchik »

Dear puppians,

I am wondering whether any of you can show me, in a simple and understandable way, how to display elapsed time in the new statusbar widget (most probably using <timer>). I would like it to update the statusbar display every second and to be able to reset it to 00:00:00 upon a button click.

Thanks in advance.

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

#350 Post by frafa »

Hello,
in case there is here using Debian or Ubuntu,
know that the last stable verstion gtkdialog 0.8.0 developed by Thunor is available in my deposit.

Code: Select all

## Depôt gtkdialog/multimystem
deb http://liveusb.info/multisystem/depot all main
#deb-src http://liveusb.info/multisystem/depot all main
#wget -q http://liveusb.info/multisystem/depot/multisystem.asc -O- | sudo apt-key add -
I can not thank enough Thunor for all the work done on gtkdialog.
François
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#351 Post by thunor »

vovchik wrote:...how to display elapsed time in the new statusbar widget (most probably using <timer>). I would like it to update the statusbar display every second and to be able to reset it to 00:00:00 upon a button click.
Hi vovchik

I've included a few commented-out instructions so that you can test the boundaries, and a pause/unpause button.

Code: Select all

#!/bin/sh

GTKDIALOG=gtkdialog

funcStatusBarUpdate() {
	SECONDS=$(($(<$ELAPSED) + 1))
	if [ $SECONDS -ge 216000 ]; then SECONDS=0; fi
	echo $SECONDS > $ELAPSED
	printf "%02d:%02d:%02d" $(($SECONDS / 3600)) \
		$(($SECONDS % 3600 / 60)) $(($SECONDS % 60)) > $MESSAGE
}
export -f funcStatusBarUpdate

export ELAPSED=$(mktemp)
echo 0 > $ELAPSED
#echo 55 > $ELAPSED
#echo 3595 > $ELAPSED
#echo 215995 > $ELAPSED

export MESSAGE=$(mktemp)
echo "00:00:00" > $MESSAGE

export MAIN_DIALOG='
<window title="StatusBar Elapsed Time" border-width="0" resizable="false">
	<vbox>
		<timer visible="false">
			<variable>tmr0</variable>
			<action>funcStatusBarUpdate</action>
			<action>refresh:stb0</action>
		</timer>
		<hbox border-width="100">
			<togglebutton>
				<label>Active</label>
				<default>true</default>
				<action>if true enable:tmr0</action>
				<action>if false disable:tmr0</action>
			</togglebutton>
			<button>
				<label>Reset</label>
				<action>echo -1 > '$ELAPSED'</action>
				<action>funcStatusBarUpdate</action>
				<action>refresh:stb0</action>
			</button>
		</hbox>
		<statusbar has-resize-grip="false">
			<variable>stb0</variable>
			<input file>'$MESSAGE'</input>
		</statusbar>
	</vbox>
	<action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG

rm $ELAPSED $MESSAGE
Regards,
Thunor
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#352 Post by 01micko »

How's your game coming along thunor?

Slacko releases in about a week, would be cool to include it 8)

Cheers
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:

#353 Post by thunor »

Dougal wrote:Thunor,
I just finished catching up on this thread and it's great what you've done, really excellent work both the features and documentation -- I see you've also added the html docs, which I thought of suggesting (I hope you deleted the old texinfo stuff...).
Cheers Dougal :)

I placed a message inside gtkdialog.texi/info warning the reader that it's very old and incomplete but still informative for beginners.
Dougal wrote:I do have one nitpick, though: your examples are really good and detailed, but have one problem: readability.
Since you use functions to auto-generate the pseudo-XML code, when an example is run it is not possible to look at the bit of code that produces a certain widget (and copy-paste it...), which I consider to be one of the main points of the examples.
When I added, extended and researched the widgets I also created examples to test their capabilities which mostly ended up being posted here, so I used functions to reduce them. Eventually I merged them into the repository and added "_advanced" to their filenames so at least the reader will know what to expect. I think your --dump suggestion is a good idea and I'll implement it when I get a chance.
Dougal wrote:Other than that, I'll have to wait until the next time I use gtkdialog (and learn all the new widgets...) to see if I have any more suggestions... (but if you get bored and aren't listening to Hell, JWM needs some love!)
Thanks for the Hell demo links; I've downloaded them and I'll give them a listen.

Mick: My game's coming along nicely and I'll see if I can make the deadline :D

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

#354 Post by 8-bit »

thunor,
You have mentioned a game you are developing.
Is it going to be a commercial release?
What type of game is it to be?
You have my curiosity aroused.
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#355 Post by vovchik »

Dear thunar,

Thanks a million for the statusbar demo. I need the elapsed time for a little sbagen player (moddded and extended from Lobster's original psbagen). I have it integrated now into my gui but would like it not to start automatically, since no sequence has been chosen. I am looking into how to do this.

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

#356 Post by thunor »

vovchik wrote:...would like it not to start automatically...
<sensitive>false<sensitive>
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#357 Post by vovchik »

Dear thunor,

Works like a charm. Thanks. This was what all the fuss was about: http://www.murga-linux.com/puppy/viewto ... 660#570660.

With kind regards,
vovchik

PS. I should actually read the dirs and generate the gtkdialog xml, but I'll do that in the next version.:)
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#358 Post by 8-bit »

Does gtkdialog/ GTK have any options that will force a window to always be dominant? That is to say it would always display in front of any other windows opened with the file manager.
I have a script with two entry boxes that can accept input directly, by chooser, or drag and drop from a Rox window.
Using drag and drop, when I open a directory using ROX, I end up having to reposition the window of my script to have the entry boxes visible for the drag and drop.

I fight this with ROX as even after using Puppy for a number of years, I still do not know if there is a command to snap two windows into a side by side layout.
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#359 Post by 01micko »

8-bit wrote:Does gtkdialog/ GTK have any options that will force a window to always be dominant? That is to say it would always display in front of any other windows opened with the file manager.
I have a script with two entry boxes that can accept input directly, by chooser, or drag and drop from a Rox window.
Using drag and drop, when I open a directory using ROX, I end up having to reposition the window of my script to have the entry boxes visible for the drag and drop.

I fight this with ROX as even after using Puppy for a number of years, I still do not know if there is a command to snap two windows into a side by side layout.
Hi 8bit

I can't speak for gtk but there is options in windowmanagers to keep a window on top.

Also, there is xdotool which can control window size/placement. Seaside wrote an app using it awhile ago for rox.

Sorry not really an answer but maybe some possibilities there.
Puppy Linux Blog - contact me for access
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#360 Post by seaside »

8-bit,

You can create an "on-top" window class by inserting in (for example JWM) the following code at the end of "/root/.jwm/jwmrc-personal" just before "</JWM>.

Code: Select all

<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:12</Option>
</Group>
Then, in your gtkdialog program call it with "gtkdialog3 -p GUI --class on-top" and presto your program will not be covered.

If you use Yad, it can do that directly by option without making an entry group as above.

Regards,
s
Post Reply