Gtkdialog Examples

For discussions about programming, and for programming questions and advice


Moderator: Forum moderators

Post Reply
User avatar
MochiMoppel
Posts: 1109
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 356 times

Re: Gtkdialog Examples

Post by MochiMoppel »

rockedge wrote: Fri Jan 27, 2023 3:49 pm

I am playing around with it and setting up the background in a similar way with the transparent Airedale silhouette. Looks great and will be a candidate for the default wallpaper/background and for it's minimal system impact.

This has not minimal system impact. IMHO this is a waste of process resources. If I understand correctly that what you and @geo_c are trying to do is put a gtkdialog or whatever window on top of the pinboard to permanently show some static text.
Commonly Puppy wallpapers have the distro name somewhere imprinted.
If this is a SVG wallpaper, and there are many, this would not only be a very efficient way to display a big image, this would also mean that (colored) text could be added/changed any time at any position. Could be done with a relatively simple script.

User avatar
rockedge
Site Admin
Posts: 5704
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1983 times
Been thanked: 2093 times
Contact:

Re: Gtkdialog Examples

Post by rockedge »

@MochiMoppel Using a SVG version of just the background is what I am intending.

User avatar
MochiMoppel
Posts: 1109
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 356 times

Re: Gtkdialog Examples

Post by MochiMoppel »

@rockedge I played with the image file /usr/share/backgrounds/431-dark.svg, found in your Fossa96-radky.
Most of the SVG files have the text portion neatly added at the end, after <!-- text --> comment.

I changed the <text> tag manually to

Code: Select all

<text style="fill:white;stroke:none;" font-family="sans" font-style="italic" font-weight="bold" font-size="38" x="70%" y="90%">Your text here</text>

, resulting in the image shown in the screenshot. Could certainly be made even fancier.

431-dark.svg.gz
This is the original SVG file, gzipped
(1.4 KiB) Downloaded 25 times

TIP: ROX-Filer can use gzipped SVG files directly as wallpaper. Just gzip any SVG file and give it a .svgz extension. This will reduce the SVG filesize considerably. (I gave the attachment a .svg.gz extension to make unzipping easier. Change to .svgz to make it digestible for ROX)

431-dark_new.jpg
431-dark_new.jpg (8.51 KiB) Viewed 1974 times
geo_c
Posts: 2495
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1794 times
Been thanked: 705 times

Re: Gtkdialog Examples

Post by geo_c »

So as not to hi-jack this topic, I'm continuing the .svg bacground image discussion here:
https://forum.puppylinux.com/viewtopic. ... 804#p79804

geo_c
Old School Hipster, and Such

User avatar
rockedge
Site Admin
Posts: 5704
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1983 times
Been thanked: 2093 times
Contact:

Re: Gtkdialog Examples

Post by rockedge »

@MochiMoppel playing around with the information you supplied:

Screenshot(11).jpg

going to set up the background directory with tip in mind.

TIP: ROX-Filer can use gzipped SVG files directly as wallpaper. Just gzip any SVG file and give it a .svgz extension. This will reduce the SVG filesize considerably. (I gave the attachment a .svg.gz extension to make unzipping easier. Change to .svgz to make it digestible for ROX)

User avatar
glene77is
Posts: 52
Joined: Thu Aug 13, 2020 7:44 pm
Location: Univ of TN, Memphis,TN,USA
Has thanked: 39 times
Been thanked: 6 times
Contact:

Re: Gtkdialog Examples

Post by glene77is »

to Don570

Thanks for the idea . :thumbup2: .
I have been tinkering with your script, and came up with the attached script.

Run this via Xterm to watch the workings.

# rc.z_CDW-DoubleClick.sh
# Example of gtkdialog application menu
# Example of Embedded Graphics
# Example of Quit Double-Click button
#
# graphics are gleaned from Linux:
# source: .svg and .xpm are (1) copied as text, (2) modified as text by hand.
# embedded graphics function this way: (1) installed in app, (2) echoed out by app, (3) imported by app gui <button> .

Double-Click Buttons and Embeded Graphics.sh  screen shot
Double-Click Buttons and Embeded Graphics.sh screen shot
CDW-DC_Txn_230212-1942-57-sh.JPEG (91.63 KiB) Viewed 1838 times
Attachments
CDW-DC_Txn_230212-1942-57-sh.zip
Double-Click Buttons and Embeded Graphics.sh executable
(2.73 KiB) Downloaded 29 times

*Just an old Apprentice caught Tinkering in the Master's WorkShop. *
Glen Ellis ( ͡° ͜ʖ ͡° ) K4KKQ , Electronic Engineering :ugeek:
Website: http://www.GeoCities.WS/glene77is :thumbup2:
Electrical Science , Memphis, TN

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

Re: Gtkdialog Examples

Post by don570 »

I didn't know that double click of a button was possible.
Thanks for example.
Zigbert has some recommendations and tips --->
https://oldforum.puppylinux.com/viewtop ... =gtkdialog

Examples: double clicking on list
or double clicking on a thumbnail image will launch image viewer.
____________________________________________-

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

Custom color buttons for Gtkdialog

Post by don570 »

I developed a system for creating custom color buttons for Gtkdialog.
Code writers are welcome to use it in scripts.

test-labels.sh.gz
fake gz extension
(4.07 KiB) Downloaded 30 times

(fake gz extension)

Notes: SVG images are stored in /tmp
You can open them with an image editor such as mtpaint.
Colors are the standard ones that SVG recognizes.
A color can have a prefix 'light' or 'dark' . Example ---> lightblue
Width of the button is automatically calculated from label text.

Instructions: Click on 'Proceed' button and then the 'Return' button.

The finished project is still available from old Puppy forum
https://oldforum.puppylinux.com/viewtop ... 41#p760041

Reference:
https://blogs.czapski.id.au/tag/gtkdialog-color

______________________________________________

xscreenshot-labels.png
xscreenshot-labels.png (27.12 KiB) Viewed 1740 times
Post Reply

Return to “Programming”