How to tell which is the gtk focus box?

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

How to tell which is the gtk focus box?

#1 Post by arivas_2005 »

regards

using this code as an example.
with varied box

Code: Select all

 #! /bin/bash

echo '1
2
3
4
5' > /tmp/list


export MAIN_DIALOG='
 <vbox>
  <hbox>	
		<tree>
		 <label>Backgrounds</label>
		 <variable>TREE</variable>
		 <input>cat /tmp/list</input> 
		 <height>300</height><width>200</width>
		</tree> 
	 </hbox>
	 
	 <hbox>
     <checkbox>
      <label>This is a checkbox</label>
      <variable>CHECKBOX</variable>
    </checkbox>
    </hbox>
    <hbox>
    <radiobutton active="true">
      <label>Radiobutton with active set to true</label>
      <variable>RADIOBUTTON1</variable>
      <action>echo Radiobutton is $RADIOBUTTON1 now.</action>
    </radiobutton>
    </hbox>
    <hbox>
    <combobox>
      <variable>COMBOBOX</variable>
      <item>First item</item>
      <item>Second item</item>
      <item>Third item</item>
    </combobox>
     </hbox>
     <hbox>
     <edit>
      <variable>EDITOR</variable>
      <width>350</width><height>150</height>
      <default>
             "This is the default text of the editor."
      </default>
    </edit>
    </hbox>
     
     
     
    <hbox>
    <text>
      <label>activates_default:</label>
    </text>
    <entry activates_default="true">
      <default>Default value</default>
      <variable>ENTRY1</variable>
    </entry>
   </hbox>

   <hbox>
    <text>
      <label>invisible_char:</label>
    </text>
    <entry invisible_char="x" visibility="false">
      <default>Default value</default>
      <variable>ENTRY4</variable>
    </entry>
  </hbox>

  <hbox>
    <text>
      <label>max_length:</label>
    </text>
    <entry max_length="5">
      <default>Default value</default>
      <variable>ENTRY5</variable>
    </entry>
    </hbox>

	<hbox>
	<colorbutton tag_attr="value"...>
        <default>data</default>        
	</colorbutton>
	 </hbox>

  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG

How I can know which is the focus box.

learning with the little I have on gtk,
I do not know how to establish whether the focus is on the checbox, or edit, or entry, etc.

excuse my english. I use traslator

Thanks

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

#2 Post by don570 »

I've noticed that if there is a row of buttons then the button on the
left side is the default when <ENTER> is pressed.

I have an example in my Gtkdialog Tutorial Manual.

http://murga-linux.com/puppy/viewtopic.php?t=89045

_______________________________________________

Post Reply