Archive for the 'Haskell' Category

Problema na comparação com SqlNull do HDBC

Thursday, December 14th, 2006

O HDBC converte para string ao comparar SqlValue’s com construtores diferentes. O problema é quando comparamos com SqlNull, porque esse construtor não pode ser convertido para String. [...]

TreeView no gtk2hs

Thursday, December 14th, 2006

Após alguns problemas, consegui fazer uma TreeView funcionar certinho no gtk2hs. Para criar:
(attributes_list :: ListStore) <- listStoreNew [TMstring, TMstring]
(attributes_view :: TreeView) <- treeViewNewWithModel attributes_list
(field_renderer :: CellRendererText) <- cellRendererTextNew
treeViewInsertColumnWithAttributes attributes_view 0 “Field” field_renderer
[("text", 0)]
(value_renderer :: CellRendererText) <- cellRendererTextNew
treeViewInsertColumnWithAttributes attributes_view 1 “Value” value_renderer
[("text", [...]

Esvaziando uma ComboBox em Gtk

Thursday, December 14th, 2006

Recentemente tive uma dúvida sobre como esvaziar uma comboBox em GTK. Estou usando uma gerada com comboBoxNewText, que já vem com o modelo pronto. O código está em Haskell, mas o processo é bem similar [...]