Page 3 of 5

Posted: Sun 15 Jan 2012, 11:20
by jpeps
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.
Maybe we can spark some interest?

Posted: Sun 15 Jan 2012, 17:13
by amigo
The greq (that'a a 'queue') GUI tool lets you put a check box under any of its' limited number of widgets.

Posted: Sun 15 Jan 2012, 18:09
by jpeps
amigo wrote:The greq (that'a a 'queue') GUI tool lets you put a check box under any of its' limited number of widgets.
Great! Maybe a link? I couldn't find anything. Thanks

Posted: Sun 15 Jan 2012, 20:14
by Keef
Google got me here....
http://greq.berlios.de/

Posted: Mon 16 Jan 2012, 00:25
by seaside

Posted: Mon 16 Jan 2012, 09:23
by jpeps
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.

Posted: Mon 16 Jan 2012, 15:26
by Moose On The Loose
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.

Posted: Mon 16 Jan 2012, 20:35
by seaside
Could this be used-

Code: Select all

<tree selection-mode="3"
It gives you multiple selection capability with a scroll bar.

Cheers,
s

Posted: Mon 16 Jan 2012, 21:22
by RSH
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?

Posted: Mon 16 Jan 2012, 23:25
by seaside
RSH,
But how to distinguish (sort out) the selected and unselected items?
All the selected items are returned separated in this variable-

Code: Select all

<variable>TREECHOICES</variable>
Cheers,
s

Posted: Tue 17 Jan 2012, 07:44
by jpeps
Not as pretty as checklists, but works nicely. <ctrl> clicking returns multiple items.

Posted: Tue 17 Jan 2012, 09:13
by RSH
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: Select all

echo $TREE1 > /tmp/list
To write the whole selection as single lines into a text file use

Code: Select all

for i in $TREE1;
	do
		echo $i >> /tmp/list
	done

Posted: Tue 17 Jan 2012, 10:02
by jpeps
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

Posted: Tue 17 Jan 2012, 17:08
by jpeps
added a "select-all" button for batch

Posted: Tue 17 Jan 2012, 18:46
by seaside
jpeps,

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
It grabs only the ".files", cuts off the ".files" extension, and makes up the list variable all in one shot.

Regards,
s

Posted: Tue 17 Jan 2012, 19:40
by RSH
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: Select all

  <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: Select all

for i in $TREEOUTPUT;
   do
      echo $i >> /tmp/list
   done

Posted: Wed 18 Jan 2012, 07:38
by jpeps
Figured a way to do the scrollable checklist with a createcheckbox function within a scrollable vbox

Posted: Wed 18 Jan 2012, 17:56
by RSH
I select "Batch Mode" then clicking on "Batch Copy" - nothing happens.

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# 
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?

Posted: Thu 19 Jan 2012, 05:31
by RSH
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. :shock:

Clicking on "Select All" opens a window with all files listed. :)

Clicking OK inside full list window executes nothing. :shock: :?

Batch list in /tmp/batch is existing :!:

Posted: Thu 19 Jan 2012, 08:49
by jpeps
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