Maybe we can spark some interest?RSH wrote: It seems to be impossible to realize my exact suggestion of a GUI List using checkboxes to just click on item to enable or disable it - using gtkdialog.
Question about Shell Script (#!/bin/sh)
Google got me here....
http://greq.berlios.de/
http://greq.berlios.de/
A little tricky, but I found a way to get it working. I don't think it has a scroll bar, which makes it kind of useless for long lists. Maybe an idea for our own gtkdialog development, though, since I'm sure it would get used a lot.
- Attachments
-
- gnewpet-greq.png
- (58.39 KiB) Downloaded 848 times
- Moose On The Loose
- Posts: 965
- Joined: Thu 24 Feb 2011, 14:54
I just thought of a way to do long lists. Here is the basic idea:jpeps wrote:A little tricky, but I found a way to get it working. I don't think it has a scroll bar, which makes it kind of useless for long lists. Maybe an idea for our own gtkdialog development, though, since I'm sure it would get used a lot.
Place a button above and below the space where a subset of the full list is shown.
When someone clicks on the up button, the dialog closes, and a new one opens with the list scrolled down by 1/2 the length of the sub-list you are showing. Te script needs to keep track of the state ON/OFF of the items in the full list and give the subset back with the right combination of check marks.
I have made a thing that works like a combo-box but allows the user entry to be filtered on a keystroke basis. This used the fact that there is an event for the loss of focus. If the scrolled list is done in its own box, this trick could be used to make the list a stand alone thing.
Could this be used-
It gives you multiple selection capability with a scroll bar.
Cheers,
s
Code: Select all
<tree selection-mode="3"
Cheers,
s
This works fine. It ( selection-mode="3") gives you the possibility to select several files.Could this be used-
Code:
<tree selection-mode="3"
But how to distinguish (sort out) the selected and unselected items?
- Attachments
-
- tree-works.jpg
- (31.81 KiB) Downloaded 794 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
RSH,
Cheers,
s
All the selected items are returned separated in this variable-But how to distinguish (sort out) the selected and unselected items?
Code: Select all
<variable>TREECHOICES</variable>
s
Yes, checklists would be my favorite as well, but "tree" is also usable. I'd just never heard about the attribute "selection-mode". Everything i'd tried gives me only single-file-selection. But this one works and i can use it for my work.jpeps wrote:Not as pretty as checklists, but works nicely.
To put the whole selection into a text file use
Code: Select all
echo $TREE1 > /tmp/list
Code: Select all
for i in $TREE1;
do
echo $i >> /tmp/list
done
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Here's a version using tree. In batch mode, the "batch copy" button opens the tree list. Select with <ctrl> click, and then push the "select pets" button.
This opens an editable box for final selection. Push the "Make Pets" button for creation in /tmp
edit: added a "select all" button in tree list
This opens an editable box for final selection. Push the "Make Pets" button for creation in /tmp
edit: added a "select all" button in tree list
- Attachments
-
- gnewpet-4.1.pet
- (2.47 KiB) Downloaded 513 times
-
- gnewpet-tree.png
- (66.6 KiB) Downloaded 778 times
jpeps,
Nicely done.
I've found it easier to build gtkdialog menu items this way-
It grabs only the ".files", cuts off the ".files" extension, and makes up the list variable all in one shot.
Regards,
s
Nicely done.
I've found it easier to build gtkdialog menu items this way-
Code: Select all
for i in *.files;do
i=${i//.files/}
LIST="$LIST<item>"$i"</item>"
done
echo $LIST # becomes input variable item list for combobox
Regards,
s
I do use this one, which works also fine. It uses original funcItemCreate.seaside wrote:jpeps,
Nicely done.
I've found it easier to build gtkdialog menu items this way-
Code:
for i in *.files;do
i=${i//.files/}
LIST="$LIST<item>"$i"</item>"
done
echo $LIST # becomes input variable item list for combobox
It grabs only the ".files", cuts off the ".files" extension, and makes up the list variable all in one shot.
Code: Select all
<tree selection-mode="3" stock="gtk-file">
<label>"'$WFNALST'"</label>
<height>200</height><width>300</width>
'"$(funcItemCreate)"'
<variable>TREEOUTPUT</variable>
</tree>
Code: Select all
for i in $TREEOUTPUT;
do
echo $i >> /tmp/list
done
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Figured a way to do the scrollable checklist with a createcheckbox function within a scrollable vbox
- Attachments
-
- gnewpet-checkbox.png
- (65.1 KiB) Downloaded 771 times
I select "Batch Mode" then clicking on "Batch Copy" - nothing happens.
Output after running gnewpet:
Output after running gnewpet:
Code: Select all
** (gtkdialog:31852): WARNING **: create_tree(): A TreeView with no label.
**
ERROR:automaton.c:1833:connect_tree_signals: assertion failed: (tree_view != NULL && Attr != NULL)
Aborted
sh-4.1#
Yes, this is exactly, what i'd meant and it looks good. Does it work or is it just step 1?jpeps wrote:Figured a way to do the scrollable checklist with a createcheckbox function within a scrollable vbox
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Inserting "<label>Batch Pets</label>" after <tree selection-mode="3"> inside your gnewpet script executes the batch window - but it is empty.
Clicking on "Select Pets" opens another empty window.
Clicking on "Select All" opens a window with all files listed.
Clicking OK inside full list window executes nothing.
Batch list in /tmp/batch is existing
Clicking on "Select Pets" opens another empty window.
Clicking on "Select All" opens a window with all files listed.
Clicking OK inside full list window executes nothing.
Batch list in /tmp/batch is existing
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]
Here's a version using gtkdialog checkboxes:
version 5.1 Put checklist in it's own scrollable vbox. Thanks RSH
version 5.2 1/23/12 Restored file report function
version 5.1 Put checklist in it's own scrollable vbox. Thanks RSH
version 5.2 1/23/12 Restored file report function
- Attachments
-
- gnewpet-5.2.pet
- (2.74 KiB) Downloaded 604 times
-
- gnewpet.png
- (78.54 KiB) Downloaded 886 times
Last edited by jpeps on Mon 23 Jan 2012, 09:15, edited 3 times in total.