-void button_set_icon( GtkButton* button, const char* icon ){
- GtkImage* image = new_local_image( icon );
- gtk_widget_show( GTK_WIDGET( image ) );
- gtk_container_add( GTK_CONTAINER( button ), GTK_WIDGET( image ) );
+guint toggle_button_connect_callback( ui::ToggleToolButton button, const Callback<void()>& callback ){
+#if 1
+ guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() );
+#else
+ guint handler = g_signal_connect_closure( G_OBJECT( button ), "toggled", create_cclosure( G_CALLBACK( clicked_closure_callback ), callback ), TRUE );
+#endif
+ g_object_set_data( G_OBJECT( button ), "handler", gint_to_pointer( handler ) );
+ return handler;
+}
+
+void button_set_icon( ui::Button button, const char* icon ){
+ ui::Image image = ui::Image(new_local_image( icon ));
+ image.show();
+ button.add(image);