| View previous topic :: View next topic |
| Author |
Message |
kingrs
Joined: 15 Jan 2006 Posts: 30 Location: Stafford, UK
|
Posted: Tue Apr 11, 2006 5:38 pm Post subject: GtkComboBox or GtkComboBoxEntry |
|
|
Hi Christian,
I understand that the GtkComboBox is depricated according to the glade design tool, does this mean I should continue with the GtkComboBoxEntry?
Two issues that may have been already covered:
1. Is there a property to stop entry in the box but still allow drop down?
2. Can I assign a key value to the each line in the combo box?
At the moment I am can populate the drop down and set the default text:
| Code: | $itemType = $glade->get_widget('cmbItemType');
$toe = array();
foreach ($localToeRs as $toe_row) {
$itemType->append_text($toe_row['description']);
$toe[$toe_row['id']] = $toe_row['description'];
}
// $itemType->get_child()->set_text('Type your own or select from the list.');
|
Bear in mind I am using glade to design the form.
Regards
Rob |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
|
| Back to top |
|
 |
kingrs
Joined: 15 Jan 2006 Posts: 30 Location: Stafford, UK
|
Posted: Wed Apr 12, 2006 12:17 am Post subject: |
|
|
I fixed the first issue:
| Code: | $itemType->get_child()->set_property('editable',false);
|
Glade design tool has the GtkComboBox in the depricated toolbox, should I just ignore this?
I can create an array to hold the keys in.
I may be able to figure out the correct way at some stage.
Regards
Rob |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Wed Apr 12, 2006 6:35 am Post subject: |
|
|
| Quote: | | Glade design tool has the GtkComboBox in the depricated toolbox |
Glade2 doesn't distinct between GtkCombo and GtkComboBox. It labels both with "Combo Box", but means "GtkCombo" in the deprecated section.
You really should use GtkComboBox if you don't need the entry.
| Quote: | | I can create an array to hold the keys in. |
As I said: Using an array has many disadvantages, e.g. if you have values twice but with a different key. When using glade, you could just replace the combobox with the indexedcombobox after loading (by cleaning its parent and re-adding the indexed one) |
|
| Back to top |
|
 |
kingrs
Joined: 15 Jan 2006 Posts: 30 Location: Stafford, UK
|
Posted: Wed Apr 12, 2006 11:05 am Post subject: |
|
|
I installed the GtkIndexedComboBox package and tried the demo, only problem is the GtkComboBox drop down requires you to keep you finger on the left mouse button while you select an entry where the GtkComboBoxEntry stays there until you select an entry.
The GtkComboBox does stay dropped down once in a blue moon.
Is there a property to specify the style of drop down?
Regards
Rob |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Wed Apr 12, 2006 3:43 pm Post subject: |
|
|
| Quote: | | GtkComboBox drop down requires you to keep you finger on the left mouse button while you select an entry |
If the combobox has the focus, I can press <space> and the selection menu pops up, without having to press the mouse button.
Further, if I click on the dropdown once, it stays open (at least for me on Linux). It could be that it's a problem with the Gtk implementation on windows. |
|
| Back to top |
|
 |
|