WIP: colmatage, encore...
This commit is contained in:
parent
63337bfbf4
commit
52b39570d3
23
callback.c
23
callback.c
|
@ -130,6 +130,29 @@ void on_glarea_unrealize(GtkWidget *widget)
|
|||
}
|
||||
}
|
||||
|
||||
void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
|
||||
{
|
||||
|
||||
GtkWidget *slider = gtk_widget_get_parent(GTK_WIDGET(data));
|
||||
GtkWidget *container_widget = gtk_widget_get_parent(GTK_WIDGET(slider));
|
||||
|
||||
const gchar *label_text = gtk_label_get_label(GTK_LABEL(data));
|
||||
|
||||
// THANKS ASCIIIII/Unicode/Whateverrr !
|
||||
int axis = label_text[0] - 'X';
|
||||
|
||||
g_assert(axis >= 0 && axis < N_AXIS);
|
||||
|
||||
/* Update the rotation angle */
|
||||
ui_update_axis_stack(container_widget,
|
||||
axis,
|
||||
gtk_adjustment_get_value(adjustment));
|
||||
|
||||
/* Update the contents of the GL drawing area */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* B U T T O N S */
|
||||
/******************************************************************************/
|
||||
|
|
|
@ -11,6 +11,8 @@ gboolean on_glarea_render(GtkGLArea *area, GdkGLContext *context);
|
|||
void on_glarea_realize(GtkWidget *widget);
|
||||
void on_glarea_unrealize(GtkWidget *widget);
|
||||
|
||||
void on_axis_value_change(GtkAdjustment *adjustment, gpointer data);
|
||||
|
||||
void ui_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, gpointer data);
|
||||
void ui_toggle_model_exec (GtkWidget *btt_run_stop_model_exec, gpointer data);
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ GtkWidget *create_axis_slider(int axis)
|
|||
gtk_widget_set_visible (label, TRUE);
|
||||
|
||||
adj = gtk_adjustment_new(0.0, 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||
////////////////////////// g_signal_connect (adj, "value-changed", G_CALLBACK(on_axis_value_change), (gpointer) label);
|
||||
g_signal_connect (adj, "value-changed", G_CALLBACK(on_axis_value_change), (gpointer) label);
|
||||
slider = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adj);
|
||||
gtk_box_append(GTK_BOX(box), slider);
|
||||
gtk_widget_set_hexpand(slider, TRUE);
|
||||
|
|
|
@ -119,6 +119,7 @@ bool graphics_init_shaders(const int stack_id);
|
|||
|
||||
bool ui_init_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_shutdown_graphic_stack(void *container_widget, GError *error_buffer);
|
||||
bool ui_update_axis_stack(GtkWidget *container_widget, int axis, int value);
|
||||
|
||||
/* Initializes the buffer of a gl_area
|
||||
* Calls according to the user preferences
|
||||
|
|
Loading…
Reference in New Issue