| Author |
Message |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Mon 16 Jan 2012, 05:23 Post subject:
|
|
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.
| Description |
|
| Filesize |
58.39 KB |
| Viewed |
639 Time(s) |

|
|
|
Back to top
|
|
 |
Moose On The Loose

Joined: 24 Feb 2011 Posts: 278
|
Posted: Mon 16 Jan 2012, 11:26 Post subject:
|
|
| 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. |
I just thought of a way to do long lists. Here is the basic idea:
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.
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 832
|
Posted: Mon 16 Jan 2012, 16:35 Post subject:
|
|
Could this be used-
| Code: | | <tree selection-mode="3" |
It gives you multiple selection capability with a scroll bar.
Cheers,
s
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Mon 16 Jan 2012, 17:22 Post subject:
|
|
| Quote: | Could this be used-
Code:
<tree selection-mode="3" |
This works fine. It ( selection-mode="3") gives you the possibility to select several files.
But how to distinguish (sort out) the selected and unselected items?
| Description |
|
| Filesize |
31.81 KB |
| Viewed |
583 Time(s) |

|
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 832
|
Posted: Mon 16 Jan 2012, 19:25 Post subject:
|
|
RSH,
| Quote: | | But how to distinguish (sort out) the selected and unselected items? |
All the selected items are returned separated in this variable-
| Code: | | <variable>TREECHOICES</variable> |
Cheers,
s
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Tue 17 Jan 2012, 03:44 Post subject:
|
|
Not as pretty as checklists, but works nicely. <ctrl> clicking returns multiple items.
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Tue 17 Jan 2012, 05:13 Post subject:
|
|
| jpeps wrote: | | Not as pretty as checklists, but works nicely. |
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.
To put the whole selection into a text file use
| Code: | | echo $TREE1 > /tmp/list |
To write the whole selection as single lines into a text file use
| Code: | for i in $TREE1;
do
echo $i >> /tmp/list
done |
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Tue 17 Jan 2012, 06:02 Post subject:
|
|
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
| Description |
|

Download |
| Filename |
gnewpet-4.1.pet |
| Filesize |
2.47 KB |
| Downloaded |
132 Time(s) |
| Description |
|
| Filesize |
66.6 KB |
| Viewed |
568 Time(s) |

|
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Tue 17 Jan 2012, 13:08 Post subject:
|
|
added a "select-all" button for batch
|
|
Back to top
|
|
 |
seaside
Joined: 11 Apr 2007 Posts: 832
|
Posted: Tue 17 Jan 2012, 14:46 Post subject:
|
|
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.
Regards,
s
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Tue 17 Jan 2012, 15:40 Post subject:
|
|
| 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.
|
I do use this one, which works also fine. It uses original funcItemCreate.
| Code: | <tree selection-mode="3" stock="gtk-file">
<label>"'$WFNALST'"</label>
<height>200</height><width>300</width>
'"$(funcItemCreate)"'
<variable>TREEOUTPUT</variable>
</tree>
|
To write complete selection as single lines into a text file use
| Code: |
for i in $TREEOUTPUT;
do
echo $i >> /tmp/list
done
|
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Wed 18 Jan 2012, 03:38 Post subject:
|
|
Figured a way to do the scrollable checklist with a createcheckbox function within a scrollable vbox
| Description |
|
| Filesize |
65.1 KB |
| Viewed |
539 Time(s) |

|
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Wed 18 Jan 2012, 13:56 Post subject:
|
|
I select "Batch Mode" then clicking on "Batch Copy" - nothing happens.
Output after running gnewpet:
| Code: | ** (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#
|
| jpeps wrote: | | Figured a way to do the scrollable checklist with a createcheckbox function within a scrollable vbox |
Yes, this is exactly, what i'd meant and it looks good. Does it work or is it just step 1?
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Thu 19 Jan 2012, 01:31 Post subject:
|
|
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
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 2421
|
Posted: Thu 19 Jan 2012, 04:49 Post subject:
|
|
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
| Description |
|
| Filesize |
78.54 KB |
| Viewed |
584 Time(s) |

|
| Description |
|

Download |
| Filename |
gnewpet-5.2.pet |
| Filesize |
2.74 KB |
| Downloaded |
164 Time(s) |
Last edited by jpeps on Mon 23 Jan 2012, 05:15; edited 3 times in total
|
|
Back to top
|
|
 |
|