Page 18 of 42

Posted: Fri 30 Sep 2011, 12:19
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 ...

Posted: Sun 02 Oct 2011, 13:40
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

Posted: Mon 03 Oct 2011, 13:59
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!)

Posted: Mon 03 Oct 2011, 14:12
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

Posted: Mon 03 Oct 2011, 15:40
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

Posted: Tue 04 Oct 2011, 21:16
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

Posted: Tue 04 Oct 2011, 21:46
by 01micko
How's your game coming along thunor?

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

Cheers

Posted: Tue 04 Oct 2011, 23:04
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

Posted: Wed 05 Oct 2011, 02:13
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.

Posted: Wed 05 Oct 2011, 10:42
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

Posted: Wed 05 Oct 2011, 17:26
by thunor
vovchik wrote:...would like it not to start automatically...
<sensitive>false<sensitive>

Posted: Wed 05 Oct 2011, 18:20
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.:)

Posted: Wed 05 Oct 2011, 22:17
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.

Posted: Wed 05 Oct 2011, 22:35
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.

Posted: Thu 06 Oct 2011, 00:30
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

Posted: Thu 06 Oct 2011, 01:35
by 8-bit
Thank you seaside. That was very informative and will help me in my daily use of Puppy and applications thereof.

Posted: Thu 06 Oct 2011, 02:14
by technosaurus
Speaking of xdotool, there are quite a few frontends that use gtkdialog along with it, to provide controls. I tried (unsuccessfully) using "tabbed" from suckless.org for its xembed capabilities to put the controls together, but it would be nice to have xembed in gtkdialog directly. The ones that come to mind are vlc-gtk and possibly a webkitgtk browser or a mupdf viewer. I think these are gtkplug and gtksocket.

Posted: Thu 06 Oct 2011, 15:11
by seaside
technosaurus wrote:Speaking of xdotool, there are quite a few frontends that use gtkdialog along with it, to provide controls. I tried (unsuccessfully) using "tabbed" from suckless.org for its xembed capabilities to put the controls together, but it would be nice to have xembed in gtkdialog directly. The ones that come to mind are vlc-gtk and possibly a webkitgtk browser or a mupdf viewer. I think these are gtkplug and gtksocket.
technosaurus,

That's a very interesting idea. While xdotool can be used in another window near a running application as a "command control", it really isn't as good as actually imbedding the program inside a gtkdialog program.

Do you think that gtkdialog code could actually have a generic "application widget" which would allow any other program to run inside a gtkdialog program's window.

That would be really attractive.

Regards,
s

Posted: Thu 06 Oct 2011, 15:46
by vovchik
Dear seaside and technosaurus,

GTK/GDK provides a number of methods for manipulating windows: http://www.gtk.org/api/2.6/gdk/gdk-Windows.html. I think Thunor would be able to implement a number of these calls, perhaps obviating the need for any foreign modules. I have implemented some of them in my bacon programs by importing the functions and making appropriate calls.

What do you think?

With kind regards,
vovchik

Posted: Thu 06 Oct 2011, 15:54
by 8-bit
Would that be similar to a vte terminal widget that was requested as a possible improvement to gtkdialog?
If I understand what a vte terminal is, would that not allow one to run any program in a widget created terminal window?

I know a terminal now can be called from gtkdialog; but only as an external process/application.