Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #18: excess surge protection


comp / comp.lang.tcl / Re: Can Tcl/Tk be used to create Xfce panel apps?

SubjectAuthor
* Can Tcl/Tk be used to create Xfce panel apps?Mark Summerfield
+* Re: Can Tcl/Tk be used to create Xfce panel apps?Luc
|`- Re: Can Tcl/Tk be used to create Xfce panel apps?Mark Summerfield
`* Re: Can Tcl/Tk be used to create Xfce panel apps?greg
 +* Re: Can Tcl/Tk be used to create Xfce panel apps?Mark Summerfield
 |`- Re: Can Tcl/Tk be used to create Xfce panel apps?Luc
 `* Re: Can Tcl/Tk be used to create Xfce panel apps?Mark Summerfield
  `- Re: Can Tcl/Tk be used to create Xfce panel apps?greg

1
Subject: Can Tcl/Tk be used to create Xfce panel apps?
From: Mark Summerfield
Newsgroups: comp.lang.tcl
Date: Wed, 10 Jul 2024 10:00 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 10 Jul 2024 10:00:56 +0000
From: mark@qtrac.eu (Mark Summerfield)
Subject: Can Tcl/Tk be used to create Xfce panel apps?
Newsgroups: comp.lang.tcl
MIME-Version: 1.0
User-Agent: Pan/0.154 (Izium; 517acf4)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
Date: Wed, 10 Jul 2024 10:00:56 +0000
Lines: 2
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kCfXn9CR1Bgk379TqB5iBlv7lP6FBByrck0cdrCy66bbNTovrj++i6gwquv1W1HVfteLKvSbuFLXzlQ!MkF00RlIqGTGxxvsws8AS29aaCow4u65dHOoUtQ0NlU63JjZzlkH+HgVMBDox3Uv1L6i2TqmgU9c!pYOHUR/BKOOW1nPSW8u3cuafDA==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

I'd quite like to create a panel app for the Xfce panel. (I know that Tcl/
Tk can create systray apps, but I want a panel button like "Launcher")

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: Luc
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Wed, 10 Jul 2024 23:16 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Date: Wed, 10 Jul 2024 20:16:50 -0300
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20240710201650.378f102e@lud1.home>
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Jul 2024 01:16:51 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a63c4d2238fc8f59b61149877e673738";
logging-data="2228233"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+W4ojsjZqlm05I55KhEeI39bdAgAzqd8U="
Cancel-Lock: sha1:FOaxtcIsPGc8emtfnXCi0QZVg7c=
View all headers

On Wed, 10 Jul 2024 10:00:56 +0000, Mark Summerfield wrote:

>I'd quite like to create a panel app for the Xfce panel. (I know that Tcl/
>Tk can create systray apps, but I want a panel button like "Launcher")
**************************

I have no idea regarding integration with XFCE but making an independent
panel with buttons that do stuff in Tcl/Tk is not only possible, it's
very easy. I suspect it can even be more capable.

And you don't really need Gnocl for that but you may want to have a look
at it. Maybe it's relevant to your needs.

--
Luc
>>

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: Mark Summerfield
Newsgroups: comp.lang.tcl
Date: Thu, 11 Jul 2024 07:42 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-4.nntp.ord.giganews.com!nntp.giganews.com!local-2.nntp.ord.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 11 Jul 2024 07:42:44 +0000
From: mark@qtrac.eu (Mark Summerfield)
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Newsgroups: comp.lang.tcl
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<20240710201650.378f102e@lud1.home>
MIME-Version: 1.0
User-Agent: Pan/0.154 (Izium; 517acf4)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <CF2dndeVPsRpERL7nZ2dnZfqn_adnZ2d@brightview.co.uk>
Date: Thu, 11 Jul 2024 07:42:44 +0000
Lines: 17
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-QWswhUlKeoDqUMRbO/fCOp81PGkC85512vuP4GPDx407GrRUCJCt2eD+U5Kx0ra9JHlM5uZoAnX3ikp!ifjoD+xz3/W24LJL+cbIaqmwDcPwc1RleWscvLhpbsnBrgPmCAsyl2pFKo5+bYY2To0Efu+OdWVq!OQ+HlsFAPBZ3KIJCQcr5GAOGVg==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Wed, 10 Jul 2024 20:16:50 -0300, Luc wrote:

> On Wed, 10 Jul 2024 10:00:56 +0000, Mark Summerfield wrote:
>
>>I'd quite like to create a panel app for the Xfce panel. (I know that
>>Tcl/
>>Tk can create systray apps, but I want a panel button like "Launcher")
> **************************
>
> I have no idea regarding integration with XFCE but making an independent
> panel with buttons that do stuff in Tcl/Tk is not only possible, it's
> very easy. I suspect it can even be more capable.
>
> And you don't really need Gnocl for that but you may want to have a look
> at it. Maybe it's relevant to your needs.

A tiny example would help...

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 11 Jul 2024 10:19 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Date: Thu, 11 Jul 2024 12:19:58 +0200
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <v6obke$2dlc7$2@dont-email.me>
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Jul 2024 12:19:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="9be51c00966dfec898df4c40cc697fc1";
logging-data="2545031"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BEd5eF9caXrIx2/ymmFx0gESCO/HtO/M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:StIs44RnRKTRLr1AtgCW/ZzaxGY=
Content-Language: de-DE
In-Reply-To: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
View all headers

Am 10.07.24 um 12:00 schrieb Mark Summerfield:
> I'd quite like to create a panel app for the Xfce panel. (I know that Tcl/
> Tk can create systray apps, but I want a panel button like "Launcher")

Hello,
(if I understood your question correctly)

Instructions for Creating a Tcl/Tk Panel Application for the Xfce Panel

Program Name: xfce_panel_app.tcl
(this name is not a default)

1.
Make the script executable:
chmod +x xfce_panel_app.tcl

2.
Script Directory:
The script should be placed in a directory. An example directory could be:
~/programs/panel_app

3.
Create the Desktop Entry:
In the directory ~/.local/share/applications/ (default)
or /usr/share/applications/ (for system-wide availability),

Create a text file with the .desktop extension.
The file name could be xfce_panel_app.desktop.
The content of the file should be as follows:

[Desktop Entry]
Version=1.0
Type=Application
Name=xfce panel app
Comment=Tcl/Tk Panel App
Exec=/home/greg/programs/panel_app/xfce_panel_app.tcl
Icon=utilities-terminal
Terminal=false
Categories=Utility;
StartupNotify=false

4.
Completion:
The application can now be found in the user menu under Utility.

5.
Adding to the Panel:
Right-click on the panel.
Select "Add New Items".
Choose "Launcher".
Configure the new launcher by selecting the previously created desktop
entry.

further information:
https://wiki.archlinux.org/title/desktop_entries
or
entry desktop xfce
or
/usr/share/applications
or
man exo-desktop-item-edit
cd ~/.local/share/applications/
exo-desktop-item-edit xfce_panel_app.tcl

best regards
Gregor

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: Mark Summerfield
Newsgroups: comp.lang.tcl
Date: Thu, 11 Jul 2024 10:36 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 11 Jul 2024 10:36:48 +0000
From: mark@qtrac.eu (Mark Summerfield)
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Newsgroups: comp.lang.tcl
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v6obke$2dlc7$2@dont-email.me>
MIME-Version: 1.0
User-Agent: Pan/0.154 (Izium; 517acf4)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <xIOdnTSqkO9cKBL7nZ2dnZfqn_WdnZ2d@brightview.co.uk>
Date: Thu, 11 Jul 2024 10:36:49 +0000
Lines: 8
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-hQUJeh9amTJWOHMVixcCuUXDFtZdlxInKgJOngR0AsQyLueKbeN/UEJJYs/f2NH5U4KIpoAU60+336L!2pnrXWk+L/8aWfi1wkapk04Tnh4oqMp1uvKYGXic5Q83ptlc0CM0ueO1JaOUGZxxqJ2HdQ1ARa/6!PhsyzrfjEmHr/UdwuKJ6trizJA==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Thu, 11 Jul 2024 12:19:58 +0200, greg wrote:
[snip]
Sorry, I think we are at cross-purposes.

You showed how to add something to the existing Xfce Launcher.

But what I want is to create my own launcher which I can add to the task
bar to _replace_ Xfce's default Launcher.

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: Luc
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Thu, 11 Jul 2024 18:53 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Date: Thu, 11 Jul 2024 15:53:26 -0300
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <20240711155326.4b04e6df@lud1.home>
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v6obke$2dlc7$2@dont-email.me>
<xIOdnTSqkO9cKBL7nZ2dnZfqn_WdnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 11 Jul 2024 20:53:27 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7d157f472c24a1e290994f5fcc6ecd01";
logging-data="2731618"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mb+QaW2O59hODTiMrkkDyzhIzNPOhH34="
Cancel-Lock: sha1:0ED7rOC2bjpnw93wFpZVDPFx3HA=
View all headers

On Thu, 11 Jul 2024 10:36:49 +0000, Mark Summerfield wrote:

>On Thu, 11 Jul 2024 12:19:58 +0200, greg wrote:
>[snip]
>Sorry, I think we are at cross-purposes.
>
>You showed how to add something to the existing Xfce Launcher.
>
>But what I want is to create my own launcher which I can add to the task
>bar to _replace_ Xfce's default Launcher.
**************************

proc p.begin {} {
package require Tk
package require tile
wm withdraw .
set ::w [toplevel .xxx -background #c0c0c0]
wm title $::w "XXXXXXXX"
tk appname "XXXXXXXX"
wm geometry $::w 200x60+20+20
wm resizable $::w 0 0
bind $::w <Escape> {exit 0}
wm protocol $::w WM_DELETE_WINDOW {exit 0}
# end of proc p.begin ====================
}

p.begin
set f1 [frame $::w.frame1]
pack $f1 -fill both -expand 1

set b1 [button $f1.button1]
$b1 configure -background blue -foreground white
$b1 configure -text "click me"
$b1 configure -command {
tk_messageBox -title "This is button 1" -message "Thanks!"
exit
} pack $b1 -side left

set b2 [button $f1.button2]
$b2 configure -background green -foreground #FFFFFF
$b2 configure -text "launch xclock"
$b2 configure -command {
exec xclock
exit
} pack $b2 -side left

--
Luc
>>

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: Mark Summerfield
Newsgroups: comp.lang.tcl
Date: Fri, 12 Jul 2024 07:13 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-4.nntp.ord.giganews.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 12 Jul 2024 07:13:46 +0000
From: mark@qtrac.eu (Mark Summerfield)
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Newsgroups: comp.lang.tcl
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v6obke$2dlc7$2@dont-email.me>
MIME-Version: 1.0
User-Agent: Pan/0.154 (Izium; 517acf4)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Message-ID: <Kf-dnTesu683Sg37nZ2dnZfqn_udnZ2d@brightview.co.uk>
Date: Fri, 12 Jul 2024 07:13:46 +0000
Lines: 4
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-wk1ELLvRx3lh+ZSUgJjdSmnTGI5MZugiDf6UD1MPHhXquzCQ3RdIw5R0OFCY1F6JEU/R11lyoaVqVtT!Gb84Dc9DlwH4FczsdUD3atk8agvcBbBj3iA+GzhzJogv/4cldBijIUFvMe8znFjqde1YjdVjQiAx!IZldEZzB0V8B7O7khgjadh/jvQ==
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

To clarify: I want to write a Tcl/Tk app that presents itself as a
menubutton (shown as an icon) that appears in the Xfce taskbar.
I don't know if this is possible since it may require using some Xfce C
library.

Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
From: greg
Newsgroups: comp.lang.tcl
Organization: A noiseless patient Spider
Date: Fri, 12 Jul 2024 21:28 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: gregor.ebbing@gmx.de (greg)
Newsgroups: comp.lang.tcl
Subject: Re: Can Tcl/Tk be used to create Xfce panel apps?
Date: Fri, 12 Jul 2024 23:28:18 +0200
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <v6s75i$36sb9$1@dont-email.me>
References: <U9qcnbciI7BFxhP7nZ2dnZfqn_idnZ2d@brightview.co.uk>
<v6obke$2dlc7$2@dont-email.me>
<Kf-dnTesu683Sg37nZ2dnZfqn_udnZ2d@brightview.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 12 Jul 2024 23:28:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="90a7842b38cea63e05755422d8836294";
logging-data="3371369"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UnyrUdzrtOEwgYCNiasjA77a8YJwTt94="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Cw05ABpozjdB5YKsWMXsMTQXq94=
Content-Language: de-DE
In-Reply-To: <Kf-dnTesu683Sg37nZ2dnZfqn_udnZ2d@brightview.co.uk>
View all headers

Am 12.07.24 um 09:13 schrieb Mark Summerfield:
> To clarify: I want to write a Tcl/Tk app that presents itself as a
> menubutton (shown as an icon) that appears in the Xfce taskbar.
> I don't know if this is possible since it may require using some Xfce C
> library.

The solution is only an approximation:

#!/usr/bin/env tclsh

package require Tk

# position xfce panel, horizontal or vertical
# https://docs.xfce.org/xfce/xfconf/xfconf-query
# xfconf-query -c xfce4-panel -lv
if {[catch {exec xfconf-query -vc xfce4-panel -p /panels/panel-1/mode}
msg ]} {
set xpos [winfo pointerx .]
set ypos [winfo pointery .]
} elseif {$msg eq "0"} {
set xpos [winfo pointerx .]
set ypos 0
} else {
set xpos 0
set ypos [winfo pointery .]
}

wm title . "Custom Menu App"
frame .mainWindow
menu .menubar
..menubar add cascade -label "Menu" -menu .menu
menu .menu
..menu add command -label "Option 1" \
-command {tk_messageBox -message "Option 1 selected"}
..menu add command -label "Option 2" \
-command {tk_messageBox -message "Option 2 selected"}
..menu add separator
..menu add command -label "Exit" -command {exit}
.. configure -menu .menubar

pack .mainWindow -expand true -fill both
wm geometry . 60x10+$xpos+$ypos
wm attributes . -topmost 1
wm attributes . -alpha 0.5

if {0} {
Adding the script to the XFCE4 panel:
Create a launcher in the XFCE4 panel that runs the Tcl/Tk script.
Right click on the XFCE4 panel and select "Panel" > "Panel preferences".
Go to the "Items" tab and click "Add".
Select "Launcher" and click "Add".
Find the new launcher in the list and click "Edit".
Click "Add a new empty item" and then click "Edit".
Enter a name for the launcher, e.g. "Custom Menu".
Enter the path to your Tcl/Tk script in the "Command" field, e.g.
/path/to/custom_menu.tcl.
}

1

rocksolid light 0.9.8
clearnet tor