Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 16 Apr 2014, 10:37
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 51 of 62 [928 Posts]   Goto page: Previous 1, 2, 3, ..., 49, 50, 51, 52, 53, ..., 60, 61, 62 Next
Author Message
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Sun 24 Mar 2013, 16:10    Post subject:  

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

With kind regards,
vovchik

PS. I am using Lucid - but very modified...upgraded and enhanced
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Tue 26 Mar 2013, 10:38    Post subject:  

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
vector_cube.tar.gz
Description 
gz

 Download 
Filename  vector_cube.tar.gz 
Filesize  39.16 KB 
Downloaded  163 Time(s) 
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Tue 26 Mar 2013, 12:32    Post subject:  

Cool, thanks! Smile
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. Confused

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Mon 01 Apr 2013, 16:51    Post subject:  

@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
Back to top
View user's profile Send private message Visit poster's website 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Mon 01 Apr 2013, 17:15    Post subject:  

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.php?p=694355#694355

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Tue 02 Apr 2013, 15:18    Post subject:  

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

Works nicely and is modest in terms of CPU use.

With kind regards,
vovchik
wavy-inline.tar.gz
Description 
gz

 Download 
Filename  wavy-inline.tar.gz 
Filesize  44.34 KB 
Downloaded  170 Time(s) 
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Tue 02 Apr 2013, 16:10    Post subject:  

Hey Vovchik

I tried to re-compile both sources and got:
Code:
# 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!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Tue 02 Apr 2013, 16:31    Post subject:  

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

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:
bacon -o -s -o -Os -o -fdata-sections -o -ffunction-sections -o -Wl,--gc-sections "$myfile"
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Tue 02 Apr 2013, 16:54    Post subject:  

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

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

Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 04 Apr 2013, 10:33    Post subject:  

Dear SFR,

I have done some nice spirals here: http://basic-converter.proboards.com/index.cgi?board=doc&action=display&thread=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
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Thu 04 Apr 2013, 17:34    Post subject:  

Tasty stuff. Smile
Here are Gtkdialog versions, but indeed, they're quite heavy, so on weaker CPUs there may be need to increase 'interval' value.

Thanks & Greetings!
spirals.tar.gz
Description 
gz

 Download 
Filename  spirals.tar.gz 
Filesize  40.52 KB 
Downloaded  147 Time(s) 

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 04 Apr 2013, 18:06    Post subject:  

Dear SFR,

Very nice. I had to increase the interval from:

Code:
interval="60"


to

Code:
interval="120"


in spiral_4.sh (line 1203) to get my old beater of a computer to respond. It now shows the animated SVG nicely. Smile

With kind regards,
vovchik
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3073
Location: Ontario

PostPosted: Mon 08 Apr 2013, 20:20    Post subject: script to explain comboboxtext widget  

Script to explain comboboxtext widget

I wanted a simpler explanation for the comboboxtext widget
so I wrote this script to show a simple implementation.
Two different methods are shown. The first shows a menu
composed of 'items'. The second has the menu composed from
a list stored in a file on your hard drive.




-------------------------------------------------------------------
comboboxtext.sh.gz
Description  remove fake gz extension to obtain script
gz

 Download 
Filename  comboboxtext.sh.gz 
Filesize  1.55 KB 
Downloaded  149 Time(s) 
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4133

PostPosted: Mon 08 Apr 2013, 21:59    Post subject:  

to eliminate excessive disk writes you can use the ram based file systems on /dev/shm or /tmp for your temporary files ... just don't forget to remove them when you are done.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
SFR


Joined: 26 Oct 2011
Posts: 876

PostPosted: Tue 09 Apr 2013, 10:07    Post subject:  

Hey Technosaurus

Yes, I'm using it ever since you told me about it in SelfCrypText thread.
And I prefer /dev/shm, because (AFAIK) /tmp might not be kept in RAM in case of full installs.

_______________

Hmm, windows can grow... Tested under JWM/IceWM.

Code:
#!/bin/bash

# Grow! by SFR'2013
# GPLv2 applies
# Req: Gtkdialog >=0.8.0, Bash

USE_BASH=; [ "`readlink /bin/sh`" != bash ] && USE_BASH="bash -c "

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

export PIC=$TEMPDIR/pic.svg
export SIZE=$TEMPDIR/size
echo 16 > $SIZE

grow () {
S=$(<$SIZE); S=$(($S+2)); echo $S > $SIZE
[ $S -ge 512 ] && exit

echo '<svg viewBox="'$((256-($S/2)))' '$((256-($S/2)))' '$S' '$S'" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <circle cx="256" cy="256" r="248" stroke="black" fill="yellow" stroke-width="10" />
  <circle cx="192" cy="160" r="24" stroke="black" fill="black" />
  <circle cx="320" cy="160" r="24" stroke="black" fill="black" />
  <path d="M 128 320 Q 256 416 384 320" stroke="black" fill="none" stroke-width="16" stroke-linecap="round" />
</svg>' > $PIC
}
export -f grow

export MAIN='
<window title="Grow! Grow! GROOOOOW!!!!!      ...ok, that'"'"'s enough...;)">
  <vbox>
    <pixmap>
      <variable>PICTURE</variable>
      <input file>'$PIC'</input>
    </pixmap>
    <timer visible="false" milliseconds="true" interval="75">
      <action>'$USE_BASH'grow</action>
      <action>refresh:PICTURE</action>
    </timer>
  </vbox>
<action signal="hide">exit:abort</action>
</window>
'

gtkdialog -cp MAIN

Have a nice day &
Greetings!

_________________
[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 51 of 62 [928 Posts]   Goto page: Previous 1, 2, 3, ..., 49, 50, 51, 52, 53, ..., 60, 61, 62 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1089s ][ Queries: 13 (0.0206s) ][ GZIP on ]