GtkDialog - tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#931 Post by seaside »

JWM can be set by placing this in /root/.jwm/jwmrc-personal-

Code: Select all

<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:12</Option>
</Group>
Openbox set by openbox rc.xml "layer" property.
http://openbox.org/wiki/Help:Applicatio ... n_settings

Cheers,
s

User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

#932 Post by neerajkolte »

Nice thread. Just bookmarking for reference.
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#933 Post by Argolance »

Bonjour,
JWM Configuration web page wrote:layer
The layer of the tray. The default is above. Valid values are below, normal, and above.
So, depending on the JWM version you are running:

Code: Select all

<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:12</Option>
</Group>
... is now deprecated and doesn't work properly.
It should be:

Code: Select all

<Group>
<Name>on-top</Name>
<Class>on-top</Class>
<Option>layer:above</Option>
</Group>
Cordialement.

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#934 Post by puppy_apprentice »

I want to make buttons UP and DOWN to move item on the list/tree gadget one place up or down. Is there built-in function for this task or i will have make own bash function for this? Maybe someone has code snippet for this?

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#935 Post by MochiMoppel »

puppy_apprentice wrote:I want to make buttons UP and DOWN to move item on the list/tree gadget one place up or down. Is there built-in function for this task or i will have make own bash function for this? Maybe someone has code snippet for this?
Zigbert provides a code snippet on the first page of this thread ("The next script shows how to move items in list by drag'n drop"). Not really buttons and I haven't tested, but maybe a start.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#936 Post by zigbert »

pBurn use buttons to move items up/down in a <tree>.
/usr/local/pburn/func_gui - line 351

Code: Select all

     <button tooltip-text=\" $(gettext 'Move item UP') \">
      <variable>MOVE_UP</variable>
      <input file stock=\"gtk-go-up\"></input>
      <visible>$VISIBLE_MOVE_UPDOWN</visible>
      <action>DIRECTION=up; . $APPDIR/func -move_up_down; . $APPDIR/func -info_burn</action>
      <action>refresh:BURNLIST</action>
     </button>
function -move_up_down is found in /usr/local/pburn/func - line 424

In the pMusic playqueue, you can move items by drag'n'drop.
/usr/local/pmusic/gui_playlist - line 27-29

Code: Select all

 <action signal="button-press-event">grep -F "$PLAYLIST" '$WORKDIR'/playlist > '$WORKDIR'/PLAYLIST_PRESS_EVENT; [ "$PLAYLIST" ] && . '$APPDIR'/menu_playqueue</action>
 <action signal="button-release-event">. '$APPDIR'/func -playlist_move</action> ##this will play the track as well
 <action signal="button-release-event">refresh:PLAYLIST</action>
The -playlist_move function is found in /usr/local/pmusic/func - line 479

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#937 Post by puppy_apprentice »

thx for both of you i will check this

titi89
Posts: 17
Joined: Fri 02 Apr 2010, 07:57

color cell tree

#938 Post by titi89 »

Hello, saddened for my English it is possible to color a cell(unit) in a tree?
And if yes how?
Thank you

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#939 Post by zigbert »

I don't think that is possible inside the <tree> widget.


Sigmund

titi89
Posts: 17
Joined: Fri 02 Apr 2010, 07:57

#940 Post by titi89 »

ok thank you

User avatar
walter leonardo
Posts: 234
Joined: Thu 10 Dec 2009, 22:10

ROhms

#941 Post by walter leonardo »

Program to calculate resistors by color codes. 8)
Attachments
ROhms.tar.gz
Program to calculate resistors by color codes.
(97.04 KiB) Downloaded 393 times

Scooby
Posts: 599
Joined: Sat 03 Mar 2012, 09:04

#942 Post by Scooby »

thanks for very useful gtkdialog tips :!:

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Gif inside Pixmap

#943 Post by mister_electronico »

Hello I was looking for ways to introduce a gif into a pixmap and set the following.

I am not a good programmer so surely anyone can improve.

However this opens possibilities for other things I want to do.

To run the pixmap_gif decompress directory and execute within:

. / pixmap_gif




______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Attachments
pixmax_gif.tar.gz
(19.01 KiB) Downloaded 329 times
Last edited by mister_electronico on Sun 08 Feb 2015, 19:04, edited 1 time in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

No forget

#944 Post by mister_electronico »

Do not forget that if not executed give execute permissions to pixmap_gif and script_01.

Greetings.




______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 19:04, edited 1 time in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Another one

#945 Post by mister_electronico »

Another one, this time a Counter.

See you.




______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Attachments
counter.tar.gz
(60.64 KiB) Downloaded 323 times
Last edited by mister_electronico on Sun 08 Feb 2015, 19:05, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#946 Post by don570 »

Note to mister_electronico..

If you're learning gtkdialog then I recommend
reading my togglebutton example page. Very neat 8)

http://208.109.22.214/puppy/viewtopic.p ... f714757e5a
_____________________________________________

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Hi don570

#947 Post by mister_electronico »

Hi don570, I like you post like other you did, but I ddn't find the relationship with my two last post.

See you.



______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 19:02, edited 1 time in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Display meter-panel.

#948 Post by mister_electronico »

I always look for a display to display data from my electronic circuits, so that I did this program gtkdialog, I think I can be useful and other people.... I hope so

The program would look like.



______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Attachments
meter_panel.png
(40.24 KiB) Downloaded 1069 times
Last edited by mister_electronico on Sun 08 Feb 2015, 19:03, edited 1 time in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

The program

#949 Post by mister_electronico »

This program can accommodate the needs that we have.

Greetings




______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Attachments
meter.tar.gz
(62.31 KiB) Downloaded 358 times
Last edited by mister_electronico on Sun 08 Feb 2015, 19:03, edited 1 time in total.

User avatar
mister_electronico
Posts: 969
Joined: Sun 20 Jan 2008, 20:20
Location: Asturias_ España
Contact:

Mobile sign

#950 Post by mister_electronico »

One mobile sign:

Code: Select all

#!/bin/bash
[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog

export DAT=/dev/shm/var1
echo "800" > $DAT


# Letro movil
funcion1 () {
VAR=( `cat $DAT` )
echo '<svg width="800" height="150" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<text x="'$VAR'" y="46" xml:space="preserve" style="font-family:monospace;font-size:64px;" font-weight="bold" fill="#7F0D0D" opacity="0.8">MOBILE SIGN WORKING</text>
</svg>' > /dev/shm/var2.svg

  VAR=`echo "$VAR - 10" | bc -l`
  echo ${VAR} > $DAT
  NUM=${VAR%%} 
  if [ $NUM -lt -720 ]; then  echo "800" > $DAT; else deci=0; fi      
}  
export -f funcion1

export MAIN='
<window title="Mobile sign" resizable="false">
  <vbox>
    <pixmap>
      <variable>IMG</variable>
      <input file>/dev/shm/var2.svg</input>
    </pixmap>
    <button ok></button>
    <timer visible="false" milliseconds="true" interval="100">
      <action>funcion1</action>
      <action type="refresh">IMG</action>
    </timer>
  </vbox>
</window>
'

case $1 in
	-d | --dump) echo "$MAIN" ;;
	*) $GTKDIALOG -cp MAIN ;;
esac
unset mobile_sign
unset funcion1
killall -9 mobile_sign.sh
Greetings


______________________________________________________________________
My blog

https://misterelectronicoes.wordpress.com/
Last edited by mister_electronico on Sun 08 Feb 2015, 19:03, edited 1 time in total.

Post Reply