WIP: g_signal_connect (...) < ne connecte pas.
This commit is contained in:
parent
8163333422
commit
dabf980346
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
void ui_toggle_run_edit()
|
void ui_toggle_run_edit()
|
||||||
{
|
{
|
||||||
if (get_run_edit_mode()) {g_printerr("Can't find self->main_button_run_edit !\n"); return;}
|
if (!get_run_edit_mode()) {g_printerr("Can't find self->main_button_run_edit !\n"); return;}
|
||||||
printf("window.ui_toggle_run_edit() >>> mode = %d", get_run_edit_mode ());
|
printf("window.ui_toggle_run_edit() >>> mode = %d", get_run_edit_mode ());
|
||||||
if (get_run_edit_mode()) {
|
if (get_run_edit_mode()) {
|
||||||
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
|
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
void on_togglerunedit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data);
|
void on_togglerunedit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data);
|
||||||
|
void ui_toggle_run_edit();
|
||||||
|
|
10
contain.c
10
contain.c
|
@ -5,6 +5,7 @@
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "contain.h"
|
#include "contain.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
#include "callback.h"
|
||||||
|
|
||||||
|
|
||||||
GtkWidget *get_edit_rules_page_new(){
|
GtkWidget *get_edit_rules_page_new(){
|
||||||
|
@ -174,7 +175,6 @@ GtkWidget *get_btt_run_xor_edit() {
|
||||||
|
|
||||||
void window_bar(GtkWindow *window, char *title){
|
void window_bar(GtkWindow *window, char *title){
|
||||||
GtkWidget *header_bar = gtk_header_bar_new();
|
GtkWidget *header_bar = gtk_header_bar_new();
|
||||||
// gtk_window_set_title (window, title);
|
|
||||||
gtk_window_set_titlebar (window, header_bar);
|
gtk_window_set_titlebar (window, header_bar);
|
||||||
|
|
||||||
// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START
|
// GtkWidget my_window_controls = *gtk_window_controls_new (GTK_PACK_END); // _START
|
||||||
|
@ -183,8 +183,12 @@ void window_bar(GtkWindow *window, char *title){
|
||||||
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "document-edit-symbolic");
|
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "document-edit-symbolic");
|
||||||
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "text-editor-symbolic");
|
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "text-editor-symbolic");
|
||||||
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
|
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
|
||||||
// gtk_actionable_set_action_name (GTK_ACTIONABLE (get_btt_run_xor_edit()), "app.togglerunedit");
|
|
||||||
g_signal_connect (GTK_BUTTON (get_btt_run_xor_edit()), "clicked", G_CALLBACK (on_togglerunedit_action()), NULL);
|
g_signal_connect (GTK_BUTTON (get_btt_run_xor_edit()),
|
||||||
|
"clicked",
|
||||||
|
G_CALLBACK (on_togglerunedit_action),
|
||||||
|
NULL);
|
||||||
|
|
||||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), get_btt_run_xor_edit());
|
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), get_btt_run_xor_edit());
|
||||||
gtk_window_set_titlebar (window, header_bar);
|
gtk_window_set_titlebar (window, header_bar);
|
||||||
|
|
||||||
|
|
17
hot.c
17
hot.c
|
@ -18,7 +18,14 @@ void set_run_edit_mode(int prescribed_mode) {run_edit_mode_val = prescribed_mode
|
||||||
int get_run_edit_mode () {return run_edit_mode_val;}
|
int get_run_edit_mode () {return run_edit_mode_val;}
|
||||||
|
|
||||||
static struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;};
|
static struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;};
|
||||||
static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child);
|
static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child){
|
||||||
|
if (parent->child) {
|
||||||
|
struct TreeNode_t *cur = parent->child;
|
||||||
|
while (cur && cur->next) {cur = cur->next;}
|
||||||
|
cur->next = child;
|
||||||
|
} else parent->child = child;
|
||||||
|
}
|
||||||
|
|
||||||
static struct TreeNode_t *create_user_tree_node (const gchar* text){
|
static struct TreeNode_t *create_user_tree_node (const gchar* text){
|
||||||
struct TreeNode_t *node = g_malloc0 (sizeof(struct TreeNode_t));
|
struct TreeNode_t *node = g_malloc0 (sizeof(struct TreeNode_t));
|
||||||
node->text = g_strdup (text);
|
node->text = g_strdup (text);
|
||||||
|
@ -118,14 +125,6 @@ GListModel* get_user_tree_model (GObject *item, gpointer root){
|
||||||
return get_user_tree_model_child (cur);
|
return get_user_tree_model_child (cur);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child){
|
|
||||||
if (parent->child) {
|
|
||||||
struct TreeNode_t *cur = parent->child;
|
|
||||||
while (cur && cur->next) {cur = cur->next;}
|
|
||||||
cur->next = child;
|
|
||||||
} else parent->child = child;
|
|
||||||
}
|
|
||||||
|
|
||||||
GtkScrolledWindow *get_user_rules_tree (){
|
GtkScrolledWindow *get_user_rules_tree (){
|
||||||
struct TreeNode_t *tree_root = create_user_tree_node("root");
|
struct TreeNode_t *tree_root = create_user_tree_node("root");
|
||||||
let_us_create_a_complex_useless_and_expensive_tree (tree_root);
|
let_us_create_a_complex_useless_and_expensive_tree (tree_root);
|
||||||
|
|
Loading…
Reference in New Issue