GTKDIALOG - Red line creation

an incubator for software projects


Moderator: Forum moderators

Post Reply
don570
Posts: 624
Joined: Sat Nov 21, 2020 4:43 pm
Has thanked: 5 times
Been thanked: 98 times

GTKDIALOG - Red line creation

Post by don570 »

GTKDIALOG - Red line creation
Related to script found here...
viewtopic.php?p=106321#p106321

I put together a script to show how to draw a horizontal red line across the window.
The width of the line is controlled by the variable WIDTH
Checked on Fatdog64 and Easy OS

screenshot-red_line.png
screenshot-red_line.png (8.65 KiB) Viewed 242 times

Code: Select all

#!/bin/sh
export WORKDIR=$HOME/.line_example
if [ ! -d $WORKDIR ]; then
	mkdir -p $WORKDIR		
fi
echo 'gtk-icon-sizes="gtk-button=32,32"
' >> $WORKDIR/gtkrc
export GTK2_RC_FILES=$WORKDIR/gtkrc # make icons bigger

WIDTH=300 # make width less than window size
echo ' <svg> <rect width="'"$WIDTH"'" height='"'3'"' fill='"'#ff0000'"'/>
</svg>
' > /tmp/line.svg
export MAIN_DIALOG='<window title="Red line example" width-request="600">
<vbox>
<text><label>"Example of red line creation"</label></text>
<hbox homogeneous="true"> 
             
<pixmap space-expand="false" space-fill="false"> <input file>/tmp/line.svg</input></pixmap> </hbox>
<hbox homogeneous="true"> <button relief="2" height-request="48" tooltip-text="Quit"> <label>'Quit'</label>
<input file stock="gtk-quit"></input> <action>exit:EXIT</action> </button>
</hbox> </vbox> </window>' gtkdialog -p MAIN_DIALOG -c
recobayu
Posts: 64
Joined: Tue Jul 14, 2020 9:34 am
Has thanked: 11 times
Been thanked: 8 times

Re: GTKDIALOG - Red line creation

Post by recobayu »

Hi @don570 ,
I also have implement a 'line-like' using svg in gtkdialog calendar here:
viewtopic.php?p=51031#p51031

Post Reply

Return to “Development”