Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Project execution event

(1/3) > >>

LETARTARE:
I am a third party plugin (AddonForQt :https://forums.codeblocks.org/index.php/topic,20000.msg172194.html#msg172194
Is there a CB event that would be generated at the beginning of a project's execution that I could intercept ?

Miguel Gimenez:
I do not think so. The complete list of events is here

LETARTARE:
Thank you.
We could create in 'sdk_event' a 'cbEVT_COMPILER_PROJECT_LAUNCHED' event, but where should we fire it ?


--- Code: ---1- 'int CompilerGCC::Run(ProjectBuildTarget* target)'
--- End code ---
just before
--- Code: ---'return 0'
--- End code ---

2- or
--- Code: ---'int CompilerGCC::DoRunQueue()'
--- End code ---
after
   
--- Code: ---'process.PID = process.pProcess->Launch(cmd->command, flags);'
--- End code ---
but here you have to wait for the command corresponding to the launch of the current project.

Is this possible ?

Miguel Gimenez:
Adding events used to require a solid reason, I do not know if this will be accepted.

Pecan:

--- Quote from: Miguel Gimenez on May 03, 2023, 02:54:02 pm ---Adding events used to require a solid reason, I do not know if this will be accepted.

--- End quote ---

I've done this before, but I used the main menu events to do it by intercepting the event id for "Run" and "Build and run".
The event id(s) were obtained and bindings were set at the "OnAppStartupDone()" event. If you set your own  bindings (connects) during this event, you'll get called before the sdk does.
Be sure to "event.Skip()", else the the sdk will stall.

Navigation

[0] Message Index

[#] Next page

Go to full version