开发者

GtkLabel reset and GtkTextView max length

  1. I've a NULL gtklabel. Upon the occurrence of an开发者_StackOverflow中文版 event, I set a text in this label (with gtk_label_set_text). How can I reset the gtklabel after the event (reset to NULL)?
  2. How can I set the max length (characters) of a GtkTextView?
  3. What's the easiest way to set the distance from the margin of a widget in a GtkTable?


  1. As I understand from code, you can just use gtk_label_set_text (label, NULL). If that fails for any reason (e.g. earlier version doesn't allow NULL), just replace it with "".
  2. You cannot, directly. Simplest non-direct approach would be to connect to "insert-text" on the view's GtkTextBuffer and g_signal_stop_emission_by_name() when you don't want the insertion to actually happen. Never did this, so it's just what I'd try, no guarantees it will really work.
  3. Not quite sure what you mean. You could try using a GtkAlignment around your widget and set padding on it — may or may not be what you want.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜