Re: Adding signal to Combobox




On Jan 31, 2007, at 2:44 AM, Mike Martin wrote:

What I am trying to do is to update the list of the combobox from a
prefernce dialog

[...]

my $title='Select Encoding Type';
$video_type->append_text("$title");

You shouldn't put instructions or labels into value lists. These things are confusing and problematic when the user tries to select them.

foreach my $type (sort keys %options){
no strict 'refs';
if ($type ne  'dir' and $type ne 'feedback'){
$video_type->append_text($options{$type}[6]);

Do i understand you correctly? You want the combo to show a different set of options based on the value of some other widget or setting?

The basic approach here is to listen for changes to that other entity, and in response to that change, update the options that the UI presents to the user. You could do the same kind of list-reload operation that you have in your manual button callback, or swap in and out various pre-made liststores. If the options are "all of these if the foo setting is 'a', or nothing if the foo setting is 'b'", you may be better off simply "graying-out" (with $widget- >set_sensitive(FALSE)) the combo when the foo setting is "b", as this is widely understood to mean "this setting makes no sense at this time".

If you are truly desperate to populate the popup when it is about to be shown, you can listen for the "popup" signal, but that is intended for use by accessibility tools, not normal application usage, so i don't expect good results there.


--
If the monkey could type one keystroke every nanosecond, the expected waiting time until the monkey types out Hamlet is so long that the estimated age of the universe is insignificant by comparison ... this is not a practical method for writing plays.
  -- Gian-Carlo Rota





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]