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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值