Page 38 of 76

Posted: Wed 20 Mar 2013, 16:24
by thunor
@SFR: Awesome work :D

I'd like to add those to the gtkdialog repository so is it okay and what is the licence? GPL2 would be good.

Regards,
Thunor

Posted: Wed 20 Mar 2013, 17:03
by SFR
Thanks :D
Sure, and GPL2 is fine.

Greetings!

Always on top or underneath

Posted: Thu 21 Mar 2013, 02:55
by brokenman
I cut my teeth on a C64. I remember the 20min load times from an external cassette reader for some games like ghost busters. Good times.

I'd like to know if it is possible to launch a gtkdialog app and have it always underneath all other apps, as opposed to always on top? I mean to say if i click the gtkdialog app it will not come to the front but remain at the back under all other apps on the desktop layer. The app is a desklet type thing that i want to remain on the desktop.

Posted: Thu 21 Mar 2013, 06:17
by 01micko
Hello brokenman

maybe try gtkdesklets by akash_rawal, supports transparency too. Ah..but you've been there! Did it not work?

There is code earlier in that thread that I used with raw gtkdialog, I wrote a weather widget , broken now of course due to the change in the sites html, but nevertheless may give you an idea
http://murga-linux.com/puppy/viewtopic. ... 629#598629.. plus even earlier there is a basic RAM widget. I got bored with widgets though after that!

Posted: Sat 23 Mar 2013, 02:47
by brokenman
Thanks very much. Your gtkdesklet seems to remain on the desktop layer and doesn't come to the front when clicked which is exactly what i need! Now i just need to scour your code to see what makes it stay there. I am using the gtkdesklet applet but my applet doesn't behave in the manner i want (staying in background).

Posted: Sun 24 Mar 2013, 12:42
by vovchik
Dear SFR,

I re-did one of your wave examples only to use markup - no svgs - and obtain the same wave effect using the little-used span markup command "rise". It gives you a y-axis displacement in "pango" units. I also use the span attrobute "letter_spacing" for the x axis (in 1024th of a point). My code is attached.

With kind regards,
vovchik

Posted: Sun 24 Mar 2013, 18:37
by SFR
Hey Vovchik

Thanks for the tip, I had no idea about this 'rise' attribute.
And, what's most important, it works also in Gtkdialog:

Code: Select all

#!/bin/bash

# DYCP 2 by SFR'2013
# Uses Vovchik's tip: markup "rise" attribute instead of svg
# GPL v2 applies

TEMPDIR=/dev/shm/dycp_$$
mkdir $TEMPDIR
trap 'rm -rf $TEMPDIR' EXIT

export SINUS=$TEMPDIR/sinus_table

# Create sinus table
for i in {0..63}; do
  RAD=`echo "$i*(3.14/64)" | bc -l`
  SIN[$i]=$(printf "%.0f" $(echo "((s($RAD)*100)+10)*1024" | bc -l))
done
echo ${SIN[@]} > $SINUS

# -----------------------------------------------------------------------------

dycp () {
TEXT="DYCP using 'rise' attribute."
SIN=( $(<$SINUS) )

echo -n '<span font="Monospace bold 36" color="black">'
for i in `seq 0 $((${#TEXT}-1))`; do
echo -n '<span rise="'${SIN[$(( ($i*3)&63 ))]}'">'${TEXT:$i:1}'</span>'
done
echo -n '</span>'

echo ${SIN[63]} ${SIN[@]:0:63} > $SINUS
}
export -f dycp

export MAIN='
<window title="DYCP" height-request="256" allow-grow="false">
  <text use-markup="true" wrap="false">
    <variable>DYCP</variable>
    <input>dycp</input>
  </text>
  <timer visible="false" milliseconds="true" interval="50">
    <action>refresh:DYCP</action>
  </timer>
<action signal="hide">exit:abort</action>
</window>
'

gtkdialog -cp MAIN
___________

PS. In .tgz below there's a couple of other old effects ported to Bash/Gtkdialog (same 'svg+refresh' technique, so nothing original really :wink: ).

Greetings!

Posted: Sun 24 Mar 2013, 18:52
by vovchik
Dear5 SFR,

Nice job. I honestly didn't know about the "rise" attribute either, until recently, and then thought it might just work. Your code is tiny, which is very nice. Too bad that <span> doesn't have an x-axis attribute like "shift". Then we could control the entire space in both directions.

With kind regards,
vovchik

Posted: Sun 24 Mar 2013, 19:25
by vovchik
Dear SFR,

The archive contains great stuff by you. I will try to port those demos. Have a problem with interference.sh, but I will try to figure out why.

With kind regards,
vovchik

Posted: Sun 24 Mar 2013, 19:53
by SFR
Oops, I think I know what kind of problems.
I forgot that in Gtkdialog-0.8.0 (you're still on Lupu, right?) in some cases closing the window through upper-right X won't terminate gtkdialog process...
So most likely my scripts just jammed your CPU (sorry about that :oops: ).
Ok, I reuploaded corrected scripts, with added:

Code: Select all

<action signal="hide">exit:abort</action>
line, which should prevent the problem.

Sorry again &
Greetings!

Posted: Sun 24 Mar 2013, 20:10
by vovchik
Dear SFR,

Many thanks, but it doesn't seem to be a gtkdialog problem. I am using thunor's latest - compiled on my machine:

Code: Select all

gtkdialog version 0.8.4 r503M
And I have all the other dependencies: bc, rsvg*. And my bash is relatively new. And everything works except for interference.sh. I am scratching my head a bit, but something will occur to me eventually. I had a similar problem in programming a chess front end a few days ago. I dimensioned two arrays from 0 to 15 to hold chess figures and, in my stupidity, wrote DECLARE xx[15], yy[15]. After hours scouring the code, it occurred to me that the arrays should be [16] in size, with indexes starting at 0 :(

With kind regards,
vovchik

PS. I am using Lucid - but very modified...upgraded and enhanced

Posted: Tue 26 Mar 2013, 14:38
by vovchik
Dear SFR,

Here are two BaCon versions of your very nice cube demo. I had to modify the bacon source because of nesting limitations in one of my versions, but both attached binaries will run just fine. And the mod to BaCon is pretty trivial and explained in the source. There is very little CPU use.

Thanks for the great stuff.

With kind regards,
vovchik

Posted: Tue 26 Mar 2013, 16:32
by SFR
Cool, thanks! :)
Precalculating sin/cos tables is instant now.

BTW, have you found out what's wrong with interference, because I tried it in Lupu (VBox) and works ok for me. :?

Greetings!

Posted: Mon 01 Apr 2013, 20:51
by thunor
@SFR

Is there a gtkdialog version of your cube demo?

I'm just committing your programs now and I was seeing if there were any more.

Regards,
Thunor

Posted: Mon 01 Apr 2013, 21:15
by SFR
Hey Thunor

Yes, a few post above, in attached tgz (I just re-uploaded it again, because vector.sh was creating some tempfiles in / instead of /dev/shm/.... Corrected now.)
http://murga-linux.com/puppy/viewtopic. ... 355#694355

Greetings!

Posted: Tue 02 Apr 2013, 19:18
by vovchik
Dear SFR,

I managed in BaCon to eliminate all disk reads and writes for your examples, which is hard to do with bash because you can't just call librsvg or gtk_image_set_from_pixbuf directly. :(

Works nicely and is modest in terms of CPU use.

With kind regards,
vovchik

Posted: Tue 02 Apr 2013, 20:10
by SFR
Hey Vovchik

I tried to re-compile both sources and got:

Code: Select all

# bacon bmrw-inline.bac 
Converting 'bmrw-inline.bac'... done.
Compiling 'bmrw-inline.bac'... Compiler emits messages!
#
hug.bac is in place already, so I guess I also need to pass some additional argument(s)..?
Any tip? :wink:

Thanks & Greetings!

Posted: Tue 02 Apr 2013, 20:31
by vovchik
Dear SFR,

I used the latest bacon 2.0 - released on 1 April - and the latest HUG 0.84. They are both available at http://www.basic-converter.org/. I just recompiled and everything works fine. I take it you have librsvg, since it's needed to transform the svgs into pixbufs. Thunor could, if he wished, make gtk_image_set_from_pixbuf available in gtkdialog, but then he would have to contend with an additional dependent functions in libsrvg, which is probably a bad idea.

If you are using the latest BaCon and latest HUG, the thing should compile without any errors. :)

With kind regards,
vovchik


PS. I used GTK2. I don't know how all of this would work with GTK3.

PPS. My compile line is:

Code: Select all

bacon -o -s -o -Os -o -fdata-sections -o -ffunction-sections -o -Wl,--gc-sections "$myfile"

Posted: Tue 02 Apr 2013, 20:54
by SFR
Oh yes, so probably BaCon version 1.0 build 29 is the cause.
I'll try later with the latest version.
But both binaries work fine. :)

EDIT: Yep, 2.0 did the job indeed - it's all right now.

Greetings!

Posted: Thu 04 Apr 2013, 14:33
by vovchik
Dear SFR,

I have done some nice spirals here: http://basic-converter.proboards.com/in ... 314&page=5. You might be "inspired" to see whether you can get them to work in gtkdialog. The only problem may be the refresh speed, but I think it should be OK even in an interpreter.

With kind regards,
vovchik