4coder » Forums » Custom theme in 4.0.17
xel
Lex Martin
3 posts
#11227 Custom theme in 4.0.17
8 months, 2 weeks ago

Hello,

I want to change the color scheme in my 4coder. I did this in 4.0.14 by calling 'set_theme_colors', but now it seems like this function doesn't do anything. I tried setting the color scheme in the config file, but it seems like variables like 'Stag_Back' are not recognized.

How should I go about modifying the color scheme in 4coder 4.0.17?

Thanks
xel
Lex Martin
3 posts
#11230 Custom theme in 4.0.17
8 months, 2 weeks ago

Fixed! I called set_hook in the wrong order for my setup hook.
Mr4thDimention
Allen Webster
283 posts
2 projects

Heyo

#11231 Custom theme in 4.0.17
8 months, 2 weeks ago

Great! If you can remember, what was the mistake you made with the hook thing? Maybe there is something I can do to make it more likely for people to do the setup correctly.
xel
Lex Martin
3 posts
#11233 Custom theme in 4.0.17
8 months, 2 weeks ago

Sure. In 4coder_default_bindings.cpp there is this piece of code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#ifndef NO_BINDING
extern "C" int32_t
get_bindings(void *data, int32_t size){
    Bind_Helper context_ = begin_bind_helper(data, size);
    Bind_Helper *context = &context_;
    
    set_all_default_hooks(context);
    default_keys(context);
    
    int32_t result = end_bind_helper(context);
    return(result);
}
#endif //NO_BINDING
.

I added this line of code
1
set_hook(context, hook_start, my_start);

on the line right before the call to set_all_default_hooks, so the call to set_all_default_hooks overwrote my start hook (I think). This was fixed by just swapping the order of these two lines.

I then ran into another issue where 4coder started crashing when it called write_and_auto_tab. I fixed this by adding
1
2
default_4coder_initialize(app);
default_4coder_side_by_side_panels(app);

in my start hook.

Thanks!
Mr4thDimention
Allen Webster
283 posts
2 projects

Heyo

#11234 Custom theme in 4.0.17
8 months, 2 weeks ago

I see, thanks for the info, I think I can do something with that.