Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #205799 > unrolled thread
| Started by | mick crane <mick.crane@gmail.com> |
|---|---|
| First post | 2019-02-28 09:20 +0100 |
| Last post | 2019-02-28 10:20 +0100 |
| Articles | 10 — 5 participants |
Back to article view | Back to linux.debian.user
advice sought for program with GUI mick crane <mick.crane@gmail.com> - 2019-02-28 09:20 +0100
Re: advice sought for program with GUI <tomas@tuxteam.de> - 2019-02-28 09:50 +0100
Re: advice sought for program with GUI Curt <curty@free.fr> - 2019-02-28 10:10 +0100
Re: advice sought for program with GUI Brian <ad44@cityscape.co.uk> - 2019-02-28 10:50 +0100
Re: advice sought for program with GUI Curt <curty@free.fr> - 2019-02-28 11:30 +0100
Re: advice sought for program with GUI Brian <ad44@cityscape.co.uk> - 2019-02-28 12:50 +0100
Re: advice sought for program with GUI <tomas@tuxteam.de> - 2019-02-28 10:20 +0100
Re: advice sought for program with GUI "Thomas Schmitt" <scdbackup@gmx.net> - 2019-02-28 12:50 +0100
Re: advice sought for program with GUI <tomas@tuxteam.de> - 2019-02-28 13:10 +0100
Re: advice sought for program with GUI "Thomas Schmitt" <scdbackup@gmx.net> - 2019-02-28 10:20 +0100
| From | mick crane <mick.crane@gmail.com> |
|---|---|
| Date | 2019-02-28 09:20 +0100 |
| Subject | advice sought for program with GUI |
| Message-ID | <xwp58-1Tg-3@gated-at.bofh.it> |
hello, I'm not very good at this stuff, have remembered bits here and there. Memory seems no so good these days. I've done pieces of simple calculations on 2D images in the past but when I go back and look at them think " now what does that do and what did I type to make it work". I'm thinking that if I do something now I should make a little GUI with buttons to click on that are self explanatory. I know nothing about that. Is that Gtk or ncurses or something ? pointers to what's needed appreciated. cheers mick -- Key ID 4BFEBB31
[toc] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2019-02-28 09:50 +0100 |
| Message-ID | <xwpy9-23f-1@gated-at.bofh.it> |
| In reply to | #205799 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Feb 28, 2019 at 08:10:41AM +0000, mick crane wrote: > hello, > I'm not very good at this stuff, have remembered bits here and there. > Memory seems no so good these days. > I've done pieces of simple calculations on 2D images in the past but > when I go back and look at them think " now what does that do and > what did I type to make it work". > I'm thinking that if I do something now I should make a little GUI > with buttons to click on that are self explanatory. > I know nothing about that. > Is that Gtk or ncurses or something ? > pointers to what's needed appreciated. There are many. For small and simple things, I *love* Tcl/Tk (which is nicely packaged for Debian). A bit aged, but: very nice integration of language and GUI toolkit; having been starved from developer power for some time, its main designers were forced to take clever decisions (which they did), and it shows. There's also TkInter -- Tk bindings for Python. It was for some time the "official" Python GUI On the other end of the scala there are Gtk and Qt, with bindings to many languages (C, Perl, Python, etc.); heavyweight, but if you are aiming at a bigger project definitely worth considering. Some Tk resources: https://wiki.tcl.tk/ https://en.wikipedia.org/wiki/Tk_(software) https://wiki.python.org/moin/TkInter https://tkdocs.com/tutorial/widgets.html (recommended: 4 language bindings) As an appetizer, and to show how language and widget set integrate, (and the canvas: ah, the wonderful Tk canvas), here's a bidirectional analog clock in under 30 lines: https://wiki.tcl-lang.org/page/counterclock Enjoy -- tomás
[toc] | [prev] | [next] | [standalone]
| From | Curt <curty@free.fr> |
|---|---|
| Date | 2019-02-28 10:10 +0100 |
| Message-ID | <xwpRw-2oU-5@gated-at.bofh.it> |
| In reply to | #205799 |
On 2019-02-28, mick crane <mick.crane@gmail.com> wrote: > hello, > I'm not very good at this stuff, have remembered bits here and there. > Memory seems no so good these days. > I've done pieces of simple calculations on 2D images in the past but > when I go back and look at them think " now what does that do and what > did I type to make it work". > I'm thinking that if I do something now I should make a little GUI with > buttons to click on that are self explanatory. > I know nothing about that. > Is that Gtk or ncurses or something ? > pointers to what's needed appreciated. There's 'dialog'. Not sure it can do self-explanatory buttons, though (jocular remark). curty@einstein:~$ apt-cache show dialog <snip> This application provides a method of displaying several different types of dialog boxes from shell scripts. This allows a developer of a script to interact with the user in a much friendlier manner. . The following types of boxes are at your disposal: yes/no Typical query style box with "Yes" and "No" answer buttons menu A scrolling list of menu choices with single entry selection input Query style box with text entry field message Similar to the yes/no box, but with only an "Ok" button text A scrollable text box that works like a simple file viewer info A message display that allows asynchronous script execution checklist Similar to the menu box, but allowing multiple selections radiolist Checklist style box allowing single selections gauge Typical "progress report" style box tail Allows viewing the end of files (tail) that auto updates background tail Similar to tail but runs in the background. editbox Allows editing an existing file > cheers > mick > -- When you have fever you are heavy and light, you are small and swollen, you climb endlessly a ladder which turns like a wheel. Jean Rhys, Voyage in the Dark
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2019-02-28 10:50 +0100 |
| Message-ID | <xwque-2C3-7@gated-at.bofh.it> |
| In reply to | #205802 |
On Thu 28 Feb 2019 at 09:04:10 -0000, Curt wrote: > On 2019-02-28, mick crane <mick.crane@gmail.com> wrote: > > hello, > > I'm not very good at this stuff, have remembered bits here and there. > > Memory seems no so good these days. > > I've done pieces of simple calculations on 2D images in the past but > > when I go back and look at them think " now what does that do and what > > did I type to make it work". > > I'm thinking that if I do something now I should make a little GUI with > > buttons to click on that are self explanatory. > > I know nothing about that. > > Is that Gtk or ncurses or something ? > > pointers to what's needed appreciated. > > There's 'dialog'. Not sure it can do self-explanatory buttons, though > (jocular remark). A default label used for a button can be overridden. > curty@einstein:~$ apt-cache show dialog > <snip> > This application provides a method of displaying several different types > of dialog boxes from shell scripts. This allows a developer of a script > to interact with the user in a much friendlier manner. Alternatives are zenity and yad. -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | Curt <curty@free.fr> |
|---|---|
| Date | 2019-02-28 11:30 +0100 |
| Message-ID | <xwr6V-34P-7@gated-at.bofh.it> |
| In reply to | #205806 |
On 2019-02-28, Brian <ad44@cityscape.co.uk> wrote: >> There's 'dialog'. Not sure it can do self-explanatory buttons, though >> (jocular remark). > > A default label used for a button can be overridden. I'm just going to flat out admit I don't understand what this means and let myself be the object of any forthcoming derision. >> curty@einstein:~$ apt-cache show dialog >> <snip> >> This application provides a method of displaying several different types >> of dialog boxes from shell scripts. This allows a developer of a script >> to interact with the user in a much friendlier manner. > > Alternatives are zenity and yad. > Okay. -- When you have fever you are heavy and light, you are small and swollen, you climb endlessly a ladder which turns like a wheel. Jean Rhys, Voyage in the Dark
[toc] | [prev] | [next] | [standalone]
| From | Brian <ad44@cityscape.co.uk> |
|---|---|
| Date | 2019-02-28 12:50 +0100 |
| Message-ID | <xwsml-3Kc-3@gated-at.bofh.it> |
| In reply to | #205807 |
On Thu 28 Feb 2019 at 10:24:48 -0000, Curt wrote: > On 2019-02-28, Brian <ad44@cityscape.co.uk> wrote: > > >> There's 'dialog'. Not sure it can do self-explanatory buttons, though > >> (jocular remark). > > > > A default label used for a button can be overridden. > > I'm just going to flat out admit I don't understand what this means and > let myself be the object of any forthcoming derision. Look for "-label" in the manual. The "OK" button, for example, can be made to read "Do it now". -- Brian.
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2019-02-28 10:20 +0100 |
| Message-ID | <xwq1b-2sa-1@gated-at.bofh.it> |
| In reply to | #205799 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Feb 28, 2019 at 10:10:03AM +0100, Thomas Schmitt wrote:
> Hi,
[...]
> If there is already a program with full functionality but complicated
> user interface, then i'd consider Tcl/Tk for the graphical frontend.
Good point.
> Tcl is not the most comfortable programming language,
Hey! this is the first time I (mildly) have to disagree with you.
Once I got to grips that Tcl is a kind of "inside-out" Lisp
(or a flip-backwards-and-a-half-turn Forth), Tcl is up there
in my favorite bunch. But I must admit that I'm weird.
Especially with more modern Tcls, having won dictionaries and
namespaces (big programs tended to turn pretty unruly with
"classic" Tcl).
The only big caveats you learn with some pain is that Tcl's
extremely simple syntax has its price (among other things,
'{}' grouping "sees" through '#' comments, ouch!).
> but Tk is about the most easy GUI definition language that i know:
Yep. Can confirm this one.
> ------------------------------------------------------------------------
> #!/usr/bin/wish
[...]
Thanks for the nice example :)
Cheers
-- t
[toc] | [prev] | [next] | [standalone]
| From | "Thomas Schmitt" <scdbackup@gmx.net> |
|---|---|
| Date | 2019-02-28 12:50 +0100 |
| Message-ID | <xwsml-3Kc-9@gated-at.bofh.it> |
| In reply to | #205803 |
Hi, [beginning to deviate from topic] I wrote: > > Tcl is not the most comfortable programming language, tomas@tuxteam.de wrote: > Hey! this is the first time I (mildly) have to disagree with you. > Once I got to grips that Tcl is a kind of "inside-out" Lisp > (or a flip-backwards-and-a-half-turn Forth), Tcl is up there > in my favorite bunch. When i wrote xorriso-tcltk as demo for a xorriso slave under a GUI master, i had a hard time with processing shell-style quoted text. In the end my solution was to let the xorriso slave parse quoted text into a more machine readable form (FORTRAN inspired, iirc) which i was able to digest in Tcl. Another unexpected obstacle was to perform the C-style gesture of pipe(2) and fork(2) in order to create the slave and to connect its stdin and stdout to the Tcl program. Single channel is easy. But two-way communications seems not to be foreseen by Mr. Ousterhout (or i am not weird enough). Solution was to teach xorriso how to start and connect to its own frontends and to let the Tcl script start xorriso which then starts another instance of the Tcl script as actually working GUI frontend. (Ok. Probably i am as weird as tomas. Just differing in detail.) Have a nice day :) Thomas
[toc] | [prev] | [next] | [standalone]
| From | <tomas@tuxteam.de> |
|---|---|
| Date | 2019-02-28 13:10 +0100 |
| Message-ID | <xwsFI-46V-29@gated-at.bofh.it> |
| In reply to | #205812 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Feb 28, 2019 at 12:43:57PM +0100, Thomas Schmitt wrote: > Hi, > > [beginning to deviate from topic] > > I wrote: > > > Tcl is not the most comfortable programming language, > > tomas@tuxteam.de wrote: > > Hey! this is the first time I (mildly) have to disagree with you. > > Once I got to grips that Tcl is a kind of "inside-out" Lisp > > (or a flip-backwards-and-a-half-turn Forth), Tcl is up there > > in my favorite bunch. > > When i wrote xorriso-tcltk as demo for a xorriso slave under a GUI master, > i had a hard time with processing shell-style quoted text. In the end my > solution was to let the xorriso slave parse quoted text into a more > machine readable form (FORTRAN inspired, iirc) which i was able to digest > in Tcl. > > Another unexpected obstacle was to perform the C-style gesture of pipe(2) > and fork(2) in order to create the slave and to connect its stdin and > stdout to the Tcl program. Single channel is easy. But two-way > communications seems not to be foreseen by Mr. Ousterhout (or i am not > weird enough). They've become better in both departments. In the second one *way* better -- with the introduction of channels [1] > Solution was to teach xorriso how to start and connect to its own > frontends and to let the Tcl script start xorriso which then starts another > instance of the Tcl script as actually working GUI frontend. Hah. I have a little gui which juggles several running instances of ffmpeg (as transcoding jobs). While it's running, you can drag-n-drop additional jobs onto it and each job shows a little progress bar and a couple of controls to cancel and things. All in all about 700 LOC, but development went smoothly. Of course, one has to think async to not get messed up. It seems Tcl has grown a bit since then. > (Ok. Probably i am as weird as tomas. Just differing in detail.) This honors me :) Cheers -- t
[toc] | [prev] | [next] | [standalone]
| From | "Thomas Schmitt" <scdbackup@gmx.net> |
|---|---|
| Date | 2019-02-28 10:20 +0100 |
| Message-ID | <xwq1b-2sa-3@gated-at.bofh.it> |
| In reply to | #205799 |
Hi,
mick crane wrote:
> I've done pieces of simple calculations on 2D images in the past but when I
> go back and look at them think " now what does that do and what did I type
> to make it work".
> I'm thinking that if I do something now I should make a little GUI with
> buttons to click on that are self explanatory.
If there is already a program with full functionality but complicated
user interface, then i'd consider Tcl/Tk for the graphical frontend.
Tcl is not the most comfortable programming language, but Tk is about
the most easy GUI definition language that i know:
------------------------------------------------------------------------
#!/usr/bin/wish
proc say_test {} {
set echo_result [exec /bin/echo "TEST"]
puts "Output of external program: $echo_result"
}
proc end_program {} {
puts "Ending"
exit 0
}
frame .test_frame
label .head_line -text "--- Headline ---"
pack .head_line -in .test_frame
button .test_button -text "Test" -command "say_test"
pack .test_button -in .test_frame
button .end_button -text "End" -command "end_program"
pack .end_button -in .test_frame
pack .test_frame
------------------------------------------------------------------------
Have a nice day :)
Thomas
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.user
csiph-web