[Github-comments] [geany/geany-plugins] 'Debugger' plugin port to GTK3 with GTK2 compatibility (#791)
Colomban Wendling
notifications at xxxxx
Wed Dec 5 18:49:15 UTC 2018
b4n commented on this pull request.
> }
g_list_free(modules);
gtk_combo_box_set_active(GTK_COMBO_BOX(debugger_cmb), 0);
/* arguments */
args_frame = gtk_frame_new(_("Command Line Arguments"));
+#if GTK_CHECK_VERSION(3, 0, 0)
+ hbox = gtk_scrolled_window_new(
+ gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(args_textview)),
+ gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(args_textview)));
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(hbox), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
Be it in GTK2 or GTK3, to actually be scrollable you need to put most widgets in a GtkScrolledWindow. The widgets "supporting scrolling" like GtkTreeView and GtkTextView know how to communicate with the ScrolledWindow. On GTK3 it's a proper interface; on GTK2 it was signals only.
Basically, what you usually would do is simply create a ScrolledWindow with passing `NULL` as the adjustments, and let GTK do it's thing when you add the child widget.
So, basically you could just use `gtk_scrolled_window_new(NULL, NULL)` followed by `gtk_container_add()` in bot GTK2 and GTK3.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/791#discussion_r239191008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20181205/330f7d15/attachment.html>
More information about the Github-comments
mailing list