Gtkdialog Development

Under development: PCMCIA, wireless, etc.
Message
Author
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

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

#361 Post by 8-bit »

Thank you seaside. That was very informative and will help me in my daily use of Puppy and applications thereof.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#362 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#363 Post 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

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

#364 Post 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
Last edited by vovchik on Thu 06 Oct 2011, 16:10, edited 2 times in total.

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

#365 Post 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.

Post Reply