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
    评论
coding in delphi 2015 ,最新英文版。Well, here we are again.This book is to follow my first book, Coding in Delphi. I was humbled and pleased by the reception it received, and so I decided to give book writing another shot. The first book didn’t have many screen shots of forms and such. The focus was on the code. Ultimately, that’s what we developers produce, right? I thought it would be a good idea to write another book of the same ilk because, well, the first one worked out really well and because there was a lot more to write about. However, this one will have a few screen shots in it, as there are some coding principles – parallel programming comes to mind – where a simple console application won’t quite illustrate things well. So this book will have some VCL applications in the demo code. I’ve actually broken down and included an entire chapter on VCL component writing. My friend, Bob Dawson, suggested that it has been quite a while since anyone wrote about components, and I decided he was right. So we’ll get a chapter covering the latest techniques on building the immortal TSmiley. But the focus will remain, as always, on the code. One of the reasons that I’ve written these books is that they force me to learn new things. I’ll be honest: at the start of the first book, I didn’t always know enough to write a complete chapter on the topic at hand (cough, parallel programming, cough, cough). But I used writing about the topic as an opportunity to learn all I could and share it with you. The same is true of this book – I’ve learned a lot in writing it. This seems to work well, as we both end up smarter. I love learning, and I assume you do, too, because you bought this book. They say that you never really know a topic until you have to teach it, and these books are my way of teaching to learn, in addition to giving back to the Delphi community that has given me so much. Another aspect to this book is that it uses a number of open source frameworks to teach the principles

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值