[SOLVED] error in combobox select

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

[SOLVED] error in combobox select

#1 Post by arivas_2005 »

regards

in /usr/share/doc/gtkdialog/examples/combobox I found the following example
(puppy slacko 5.4..)

Code: Select all

#!/bin/sh

GTKDIALOG=gtkdialog

MAIN_DIALOG='
<window>
	<vbox>
		<hbox>
			<text>
				<label>Combobox</label>
			</text>
			<combobox width-request="295">
				<variable>COMBOBOX</variable>
				<item>First item</item>
				<item>Second item</item>
				<item>Third item</item>
			</combobox>
		</hbox>
		<hbox>
			<button ok></button>
			<button cancel></button>
		</hbox>
	</vbox>
</window>
'
export MAIN_DIALOG

 I=$IFS; IFS=""
   for STATEMENTS in  $(gtkdialog --program MAIN_DIALOG); do
      eval $STATEMENTS
    done
 IFS=$I

	Xdialog --title "View selection" --msgbox $COMBOBOX " select" 10 60 & MSGID23=$!
	sleep 5
	kill $MSGID23 2>/dev/null  
Problem:
in xdialog only shows the first word of the items: "First", "Second" or "Third"; ignores the second words: "item" in the three lines.

but to remove the space in the "First item" (Example: item>Firstitem</item>), then shows the full term xdialog

How to select the whole phrase including spaces

excuse for my English. and thanks
Last edited by arivas_2005 on Thu 07 Nov 2013, 02:31, edited 1 time in total.

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

Have you tried quotes i.e.

Code: Select all

<item>"First item"</item> 
_________________________________

arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

#3 Post by arivas_2005 »

The error continues, only appears the first word. For the third case only Third (no Third item).

I hope there is another way
thanks

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#4 Post by don570 »

next step : try two quotes . strong and weak

Code: Select all

<item>"'First item'"</item>
then try substitution

Code: Select all

<item>"'$VAR'"</item>

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#5 Post by don570 »

Baconrecorder 4.4
has a combo box that works.

_________________________________________

arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

#6 Post by arivas_2005 »

thanks don570

Xdialog is error. always gives a word (first word)

I tested the console and observed see the complete sentence.

I used reference baconrecorder.

Post Reply