Mailinglist Archive: yast-devel (121 mails)

< Previous Next >
[yast-devel] A few questions about libYUI
  • From: Manu Gupta <manugupt1@xxxxxxxxx>
  • Date: Thu, 23 Jun 2011 02:58:01 +0530
  • Message-id: <BANLkTi=7yztAra1Wwkkj54dFxN3hWA-Chg@mail.gmail.com>
Hi

I am trying a few things in libYUI to ask of

1. How to set a value in a ComboBox?
I have tried with both editable and non-editable comboBoxes

I have a
YComboBox * cc = YUI::widgetFactory(dialog,"SELECT",true);
cc->addItem("XYZ");
cc->addItem("Blah");
cc->setValue("Manu");

In this case, the value Manu is not set and highlighted

Now lets take this case
YComboBox * cc = YUI::widgetFactory(dialog,"SELECT",true);
cc->addItem("XYZ");
cc->addItem("Blah");
cc->setValue("Blah");

Same thing blah is not highlighted

case 3
YComboBox * cc = YUI::widgetFactory(dialog,"SELECT",false);
cc->addItem("XYZ");
cc->addItem("Blah");
cc->setValue("Blah");

I get a YUI::Exception

So if anyone can cross check this case and let me know if it is a bug or not?

Second Question is related to event handling

If a selection in a comboBox changes, how would I able to recognise it

Currently I follow this approach
YDialog * dialog = YUI::widgetFactory->createDialog();
YComboBox * cc = YUI::widgetFactory(dialog,"SELECT",false);
YWidgetEvent * event = (YWidgetEvent*)dialog->waitForEvent();
while(1){
if(event->reason()==SelectionChanged){
cout<<"XYZ";
}
};

this does not seem to work ie the dialog is not recognising changes in
my combobox, how do I solve them?

--
Regards
Manu Gupta
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >