<div dir="ltr">Hi Matthew, <div><br></div><div>Thanks for your explanation about the process of page switch. It is very helpful for me. I want to recognize all malloc or new memory allocation functions related with one tab page. I hope to log all this memory allocation functions information related with this one tab no any other tabs. So I need one concrete identification for each tab. I will look at GtkNotebook widget.</div><div><br></div><div>Best Regards,</div><div>Pengfei</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 23, 2015 at 8:30 PM, Matthew Brush <span dir="ltr"><<a href="mailto:mbrush@codebrainz.ca" target="_blank">mbrush@codebrainz.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 15-10-23 09:21 AM, Pengfei Sun wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Lex,<br>
<br>
I have one question about tab switch in the geany. I know the different tab<br>
has different doc->id. I think there is only one thread which manages all<br>
tabs, right?  I wonder when we switch different tabs to edit the document.<br>
How does geany manage or recognize different tabs? g_main_context_check<br>
will be called in g_main_loop_run. Whether the data structure GMainContext<br>
will include some information which can recognize the different tab?<br>
<br>
</blockquote>
<br></span>
Hi,<br>
<br>
I know you weren't addressing me, but you might want to look into GTK+, the event-driven GUI toolkit Geany uses. When user changes a tab, the GtkNotebook widget emits a signal telling Geany about the event, and then Geany asks the GtkNotebook for the widget contained in the selected tab page, which (eventually) contains the Scintilla widget, via the GTK+ widget hierarchy.<br>
<br>
If you're trying to track down the control flow via GDB or other debugger, the event-driven model is going to send you on a wild goose chase through hell :)<br>
<br>
FWIW, doc->id is basically not very useful, it just tells the index into some internal array of GeanyDocument objects, but is not unique to each document/tab per se (it gets recycled for new documents and such).<br>
<br>
Cheers,<br>
Matthew Brush<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" rel="noreferrer" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div>