Simple GtkDialog gui... How To Do.?
Simple GtkDialog gui... How To Do.?
A gui to build a list of image files selected with the gtk file chooser.
So a listbox and a filer button with Ok to write the listbox to a file.
Simple right.? I tried many different methods, none worked.
I figured just write each /path/file selected to a file and refresh the listbox. Nope...
So I tried using the tree and it`s insert method didn`t work.
Or for example: 2 lists, one refreshes the other with it`s selected item.?
I`ve made a few guis like this in the past, but none of the code works now.
.
So a listbox and a filer button with Ok to write the listbox to a file.
Simple right.? I tried many different methods, none worked.
I figured just write each /path/file selected to a file and refresh the listbox. Nope...
So I tried using the tree and it`s insert method didn`t work.
Or for example: 2 lists, one refreshes the other with it`s selected item.?
I`ve made a few guis like this in the past, but none of the code works now.
.
This has nothing to to with refreshing , but it might interest you.
It's a script to save text to a file. I will put it in the next version of my
manual .
_______________________________________
It's a script to save text to a file. I will put it in the next version of my
manual .
_______________________________________
- Attachments
-
- script66.sh.gz
- Remove fake gz extension
- (1.66 KiB) Downloaded 292 times
I see your solution, use an edit box instead of a list or tree. This is usable for my purpose.
I tried using 8 entry boxes as that`s all that`s needed.
But as each /path/file is selected, how to cycle through them.?
Perhaps "eval" can allow each entry`s variable inside another variable...
### UPDATE: Still couldn`t figure this out. Don`t see how to get: FileChooser > Editor
There`s no example of loading the Editor from a variable or file. Only saving it.
### Other needed gui:
2 lists, selecting in first then triggers second to load a list pointed to by the selection.
Much like a 2 panel Filer. Selection in the dir panel triggers loading the dir list in the second.
.
I tried using 8 entry boxes as that`s all that`s needed.
But as each /path/file is selected, how to cycle through them.?
Perhaps "eval" can allow each entry`s variable inside another variable...
### UPDATE: Still couldn`t figure this out. Don`t see how to get: FileChooser > Editor
There`s no example of loading the Editor from a variable or file. Only saving it.
### Other needed gui:
2 lists, selecting in first then triggers second to load a list pointed to by the selection.
Much like a 2 panel Filer. Selection in the dir panel triggers loading the dir list in the second.
.
As usual, an entire afternoon spent with GtkDialog. A common gui... File chooser adds to list.
And the solution is hacky and definitely a brute force method. But it works.
As you can see, all I could get to work properly was the entry box.
Tried to do one file chooser for all entries, but I can`t get math ((N=N+1)) to work in GtkDialog.
And the solution is hacky and definitely a brute force method. But it works.
As you can see, all I could get to work properly was the entry box.
Tried to do one file chooser for all entries, but I can`t get math ((N=N+1)) to work in GtkDialog.
- Attachments
-
- WallPapersSelector_Burke_01.png
- (160.42 KiB) Downloaded 546 times
With a screenshot like that I'm not sure I can do N=N+1 either.sunburnt wrote:Tried to do one file chooser for all entries, but I can`t get math ((N=N+1)) to work in GtkDialog.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
I don't know that both these forms work. I suppose the first one is probably for bash, what does the 2nd one works on?amigo wrote:((N=N+1)) vs. $((N=N+1)) depends on the shell.
EDIT: second one works on bash, ash, and (surprisingly) dash, too.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]
Not sure if still needed (or I understand the need...) but below will add a selected file to the list (although gtkdialog2 seems to double the lines).
Code: Select all
#! /bin/bash
export MAIN_DIALOG='
<vbox>
<hbox>
<text>
<label>Add a fileselection to a list through an entry with action append to list:
</label>
</text>
</hbox>
<hbox>
<button>
<label>add from file</label>
<action fileselection>ENTRY</action>
</button>
<entry>
<variable>ENTRY</variable>
<action>append:ENTRY,LIST</action>
</entry>
</hbox>
<vbox>
<list>
<variable>LIST</variable>
</list>
<hbox>
<button>
<label>Clear</label>
<action>clear:LIST</action>
</button>
<button>
<label>Removeselected</label>
<action removeselected>LIST</action>
</button>
</hbox>
</vbox>
<hbox>
<button ok>
<action>exit</action>
</button>
<button cancel>
<action>exit</action>
</button>
</hbox>
</vbox>
'
gtkdialog2 -d --program=MAIN_DIALOG
Well it`s been 5 days with the flu my girlfriend brought home. It`s been a kind one though...
goingnuts; I`ll try your code in a bit, cooking the Christmas ham here.
I still don`t see how to do math within GtkDialog, but using bc "almost" worked.
I can`t remember who it was that showed me the math piece, he doesn`t come here any more.
From the philippines as I recall, a damn nice guy just like the lot of you are...
Merry Christmas fellow Puppians, one and all..! Terry Becker
.
goingnuts; I`ll try your code in a bit, cooking the Christmas ham here.
I still don`t see how to do math within GtkDialog, but using bc "almost" worked.
I can`t remember who it was that showed me the math piece, he doesn`t come here any more.
From the philippines as I recall, a damn nice guy just like the lot of you are...
Merry Christmas fellow Puppians, one and all..! Terry Becker
.
goingnuts; My Puppy precise.5.4.X.5 doesn`t have a gtkdialog2 file or link, so error.
Renamed the call in you script and it errors at the button action line.
Perhaps a newer version of GtkDialog is needed. 0.8.3 seems pretty new though...
I got this to work, but it double spaces like you say ( See version above ):
# Sadly to me as an occasional user, GtkDialog doesn`t seem better at all.
I know how hard a job Thunor has, GTK+ is a real can constantly changing of worms.
I guess I really pray for a good replacement for GTK+ ...
.
Renamed the call in you script and it errors at the button action line.
Perhaps a newer version of GtkDialog is needed. 0.8.3 seems pretty new though...
Code: Select all
gtkdialog version 0.8.3 r493M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Code: Select all
<list>
<variable>LIST</variable>
<input>cat /path/file</input>
</list>
I know how hard a job Thunor has, GTK+ is a real can constantly changing of worms.
I guess I really pray for a good replacement for GTK+ ...
.
I played a little too not understanding exactly what you want to do.
I changed the add from file part something like:
This brought up a file selection window that would add files to the list variable and appear in the window of selected files.
For the Remove Selected button action, I had to use:
<action>Removeselected:LIST</action>
The information was found by looking at /usr/share/doc/gtkdialog/reference/list.html.
And I am also using the version of gtkdialog that was packaged with slacko 5.5.
I changed the add from file part something like:
Code: Select all
<button>
<label>add from file</label>
<action type="fileselect">ENTRY</action>
</button>
<entry>
<variable>ENTRY</variable>
<action>append:ENTRY,LIST</action>
For the Remove Selected button action, I had to use:
<action>Removeselected:LIST</action>
The information was found by looking at /usr/share/doc/gtkdialog/reference/list.html.
And I am also using the version of gtkdialog that was packaged with slacko 5.5.
Hi 8bit; Hope your Christmas was a good one.
I spent another few hours with GtkDialog with no more luck.
# The need is a very common and simple gui type:
List
Button to add List items ( /path/file in this case ... and shouldn`t need an Entry to make a List work )
Button to remove items ( your example worked very nicely 8bit. Thank you.! )
Ok button to use the List items ( writes them to a file in this case )
Cancel ...
In this case, the FileChooser button could write the item directly to a file, and refresh the List.
But this is a round-about method, correct way is to add directly to the list ( no refreshing ).
# Sadly, my gui with 8 Entry boxes is still the only truly working one I have.
# amigo and technosaurus; I think the leading $ is only if it`s to be used like a variable ( stdout ).?
### And I wanted to respond to amigo and jamesbond:
"Yes, whatever the subject is,"
Brooke Burke always has an impressive pair of points to offer...
.
I spent another few hours with GtkDialog with no more luck.
# The need is a very common and simple gui type:
List
Button to add List items ( /path/file in this case ... and shouldn`t need an Entry to make a List work )
Button to remove items ( your example worked very nicely 8bit. Thank you.! )
Ok button to use the List items ( writes them to a file in this case )
Cancel ...
In this case, the FileChooser button could write the item directly to a file, and refresh the List.
But this is a round-about method, correct way is to add directly to the list ( no refreshing ).
# Sadly, my gui with 8 Entry boxes is still the only truly working one I have.
# amigo and technosaurus; I think the leading $ is only if it`s to be used like a variable ( stdout ).?
### And I wanted to respond to amigo and jamesbond:
"Yes, whatever the subject is,"
Brooke Burke always has an impressive pair of points to offer...
.
sunburnt: GtkDialog1-1.3 will add directly to list without duplicates - run "examples/fselect2list_test" to test.
- john biles
- Posts: 1458
- Joined: Sun 17 Sep 2006, 14:05
- Location: Australia
- Contact:
Hello sunburnt,
How can anyone focus on your GUI with a wallpaper like that. Any other interesting wallpapers you'd like to share. LOL!
How can anyone focus on your GUI with a wallpaper like that. Any other interesting wallpapers you'd like to share. LOL!
- Attachments
-
- WallPapersSelector_Burke_01.png
- (160.42 KiB) Downloaded 379 times
Legacy OS 2017 has been released.
The problem with this is that the version of gtkdialog you reference is a group remake of gtkdialog that will not work with a lot of Puppy gtk scripts and until all of this is worked out with the version you reference included in most Puppys by default, one would end up with an application that required a specific version.goingnuts wrote:sunburnt: GtkDialog1-1.3 will add directly to list without duplicates - run "examples/fselect2list_test" to test.
I remember the rewrites of scripts to comply with the latest version of gtkdialog by thunor.
And correct me if I am wrong. Gtkdialog 1-1.3 you refer to is a work/rewrite in progress.