From: <j.r...@gm...> - 2008-10-27 12:30:59
Attachments:
ComboBoxTest.hs
|
Hello. In order to learn how to program a ComboBoxEntry widget, I've written the attached Haskell program. I would be happy if somebody could take a look at this program, and help with the follwoing Gtk-CRITICAL error message: (ComboBoxTest:30650): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed This error happens whenever an option is chosen from the combo box. Another issue I want to deal with is the alignment of the options in the combo box. They are centered horizontally. If the third argument to cellLayoutPackStart is False, they are aligned to the right. But I want them aligned to the left. How can I get it? Any clues? Romildo |
From: Axel S. <Axe...@en...> - 2008-10-27 13:35:09
Attachments:
ComboBoxTest.hs
|
On Mon, 2008-10-27 at 10:30 -0200, j.r...@gm... wrote: > Hello. > > In order to learn how to program a ComboBoxEntry widget, I've written > the attached Haskell program. > > I would be happy if somebody could take a look at this program, and help > with the follwoing Gtk-CRITICAL error message: > > (ComboBoxTest:30650): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed > > This error happens whenever an option is chosen from the combo box. The combo box in Gtk+ has this weird behaviour that a CellRendererText is always added and that this renderer takes it's cellText from a String column specified by comboBoxEntryTextColumn. This is a bit brain damaged and but too late to change. > Another issue I want to deal with is the alignment of the options in the > combo box. They are centered horizontally. If the third argument to > cellLayoutPackStart is False, they are aligned to the right. But I want > them aligned to the left. How can I get it? > > Any clues? I've attached the revised program. It might now be easier to find out why the layout is so bad. You're next question is probably how to add the text entered by the user to the model. I think there're some signals missing, I'll look into that. Axel. > Romildo > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ Gtk2hs-users mailing list Gtk...@li... https://lists.sourceforge.net/lists/listinfo/gtk2hs-users |
From: <j.r...@gm...> - 2008-10-27 22:33:03
|
On Mon, Oct 27, 2008 at 02:34:56PM +0100, Axel Simon wrote: > On Mon, 2008-10-27 at 10:30 -0200, j.r...@gm... wrote: > > Hello. > > > > In order to learn how to program a ComboBoxEntry widget, I've written > > the attached Haskell program. > > > > I would be happy if somebody could take a look at this program, and help > > with the follwoing Gtk-CRITICAL error message: > > > > (ComboBoxTest:30650): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed > > > > This error happens whenever an option is chosen from the combo box. > > The combo box in Gtk+ has this weird behaviour that a CellRendererText > is always added and that this renderer takes it's cellText from a String > column specified by comboBoxEntryTextColumn. This is a bit brain damaged > and but too late to change. > > > Another issue I want to deal with is the alignment of the options in the > > combo box. They are centered horizontally. If the third argument to > > cellLayoutPackStart is False, they are aligned to the right. But I want > > them aligned to the left. How can I get it? > > > > Any clues? > > I've attached the revised program. It might now be easier to find out > why the layout is so bad. Thanks for pointing out the behaviour of combo boxes in Gtk+. > You're next question is probably how to add the text entered by the user > to the model. I think there're some signals missing, I'll look into > that. Yes, this is my next question. There is the changed signal. Together with comboBoxGetActive (which returns -1 when the change is due to editing the entry field), it is possible to take some action when the entry changes. The problem is that every single change to the entry text (like adding or deleting a single letter) emits this signal. It would be nice to have a signal emitted only when editing the entry finishes. Then one could add the new value to do model. Romildo |
From: Axel S. <Axe...@en...> - 2008-10-27 23:20:48
|
On Oct 27, 2008, at 19:25, j.r...@gm... wrote: > Yes, this is my next question. > > There is the changed signal. Together with comboBoxGetActive (which > returns -1 when the change is due to editing the entry field), it is > possible to take some action when the entry changes. The problem is > that > every single change to the entry text (like adding or deleting a > single > letter) emits this signal. > > It would be nice to have a signal emitted only when editing the entry > finishes. Then one could add the new value to do model. Yes, so you can extract the Entry from the ComboBoxEntry widget and connect to it's entryActivate signal. I've added a demo in the darcs repository under demo/menu/ComboDemo.hs It's like your file, only a bit simpler. Axel. |