- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (!cb->m_hasVMT || g_blockEventsOnDrag)
- return;
-
- if (cb->m_blockEvent) return;
-
- // Generate a wx event.
- wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
- event.SetInt(cb->GetValue());
- event.SetEventObject(cb);
- cb->GetEventHandler()->ProcessEvent(event);
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ if (!cb->m_hasVMT || g_blockEventsOnDrag)
+ return;
+
+ if (cb->m_blockEvent) return;
+
+ // Generate a wx event.
+ wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
+ event.SetInt(cb->GetValue());
+ event.SetEventObject(cb);
+ cb->GetEventHandler()->ProcessEvent(event);
if (!PreCreation(parent, pos, size) ||
!CreateBase(parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG(wxT("wxToggleBitmapButton creation failed"));
if (!PreCreation(parent, pos, size) ||
!CreateBase(parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG(wxT("wxToggleBitmapButton creation failed"));
- gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
- GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
- (gpointer *)this);
+ g_signal_connect (m_widget, "clicked",
+ G_CALLBACK (gtk_togglebutton_clicked_callback),
+ this);
}
// void SetValue(bool state)
// Set the value of the toggle button.
void wxToggleBitmapButton::SetValue(bool state)
{
}
// void SetValue(bool state)
// Set the value of the toggle button.
void wxToggleBitmapButton::SetValue(bool state)
{
GdkBitmap *mask = (GdkBitmap *) NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
GdkBitmap *mask = (GdkBitmap *) NULL;
if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap();
}
void wxToggleBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
}
void wxToggleBitmapButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
- if (!PreCreation(parent, pos, size) ||
- !CreateBase(parent, id, pos, size, style, validator, name )) {
- wxFAIL_MSG(wxT("wxToggleButton creation failed"));
- return FALSE;
- }
- wxControl::SetLabel(label);
+ if (!PreCreation(parent, pos, size) ||
+ !CreateBase(parent, id, pos, size, style, validator, name )) {
+ wxFAIL_MSG(wxT("wxToggleButton creation failed"));
+ return false;
+ }
- gtk_signal_connect(GTK_OBJECT(m_widget), "clicked",
- GTK_SIGNAL_FUNC(gtk_togglebutton_clicked_callback),
- (gpointer *)this);
+ // Create the gtk widget.
+ m_widget = gtk_toggle_button_new_with_label( wxGTK_CONV( m_label ) );
- m_parent->DoAddChild(this);
+ g_signal_connect (m_widget, "clicked",
+ G_CALLBACK (gtk_togglebutton_clicked_callback),
+ this);
+
+ m_parent->DoAddChild(this);
}
// void SetValue(bool state)
// Set the value of the toggle button.
void wxToggleButton::SetValue(bool state)
{
}
// void SetValue(bool state)
// Set the value of the toggle button.
void wxToggleButton::SetValue(bool state)
{
}
void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);
}
void wxToggleButton::DoApplyWidgetStyle(GtkRcStyle *style)
{
gtk_widget_modify_style(m_widget, style);