Start coding

It’s time to show my code. a word , talk is cheap, show me your code .
Happily I have to start writing code, I am looking forward to it, facing my project, GNOME-LOGS. This is a cool program.
這裏寫圖片描述
Logs currently does not update the view when new log messages are added to the journal. Fixing this should also make it easier to fix several other bugs, such as showing notifications when certain other messages appear in the journal, as well as improving search filters.
I need to implement it.
I need gtk+ and c to complete this project. Fortunately, I have some basics.
Currently, I am familiar with the composition of the entire project, the relationship between the various classes.
Some problems encountered:
1. Since the time of contact with GTK+ is very short, I am not clear about debugging it. I use vim to write code and can only use GDB for debugging. But every time the code runs to the gtk+ code, debugging can’t continue. My tutor told me that you may need gtk+ and glib debug symbols installed, as sometimes it is useful to step into that code during debugging. I used some suggestions to solve some problems.
2. I don’t understand the function of some variables in the code.

Static void
On_close (GSimpleAction *action,
          GVariant *variant,
          Gpointer user_data)
{
    GtkWindow *window;
    Window = GTK_WINDOW (user_data);
    Gtk_window_close (window);
}

This user_data, I am puzzling about this.
User_data is a gpointer, which is a typecast to void *typedef There is explanation of the type macros in the gobject manual
If you look at the documentation for G_DECLARE_FINAL_TYPE, that should link to all the information

GArray *
gl_journal_get_boot_ids (GlJournal *journal)
{
    GlJournalPrivate *priv;

    priv = gl_journal_get_instance_private (journal);

    return priv->boot_ids;
}

and this one, you could get a instance by priv= gl_journal_get_instance_private (journal);
it’s very cool.

Overall, it feels good, and I look forward to more progress next week.
May 28, 2018

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章