-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gtkf-sketcher.f90: important features are still missing in the GTK 4 version #207
Comments
https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-is-toplevel
|
I have commented:
I have replaced: integer(c_int) :: dialog
dialog = gtk_dialog_run (about_dialog)
call gtk_widget_hide (about_dialog) by this code (already used in bazaar.f90): call gtk_widget_show(widget)
call g_signal_connect_swapped (widget, "response"//c_null_char, &
& c_funloc(gtk_window_destroy), widget) As a result, gtkf-sketcher.f90 is built by CMake, but of course it does no function. At the moment, 10 critical errors appears on launch and no window appears: [osboxes@localhost sketcher]$ ./gtkf-sketcher
PWD: /home/osboxes/gtk-fortran/build/sketcher
(gtkf-sketcher:4348): Gtk-CRITICAL **: 10:05:27.875: gtk_combo_box_set_active: assertion 'GTK_IS_COMBO_BOX (combo_box)' failed
... |
In GTK 3.99.2, |
I used |
The only big remaining problem is how to parse the signals of each object in the UI file: we need to store them in that array: type signal_connection
character(len=64)::object_name
character(len=64)::signal_name
character(len=64)::handler_name
end type signal_connection
type(signal_connection), dimension(:), allocatable::connections Example of an object in a UI file: <object class="GtkButton" id="button1">
<property name="hexpand">1</property>
<property name="label" translatable="yes">Button1</property>
<property name="receives_default">1</property>
<signal name="clicked" handler="hello" swapped="no"/>
</object> Note that there could also be several signals. In GTK3, it was made using two times I am not sure the answer given in the GTK Discourse is an answer to our problem: |
Another problem in gtkf-sketcher is that in GTK 3, root = gtk_buildable_get_buildable_id(gtk_widget_get_root(gpointer))
call C_F_string_ptr(root, f_string) |
Concerning GtkBuilder see: #178
The
*.glade
will also need to be ported (deprecated properties, widgets...). There is a tool to help: #188Concerning
gtk_dialog_run
see: 07771a8#diff-97fecfaa97d43167048d8b722f36eb71https://developer.gnome.org/gtk4/unstable/ch40s02.html#id-1.7.4.4.62
See also the
hl_gtk_file_chooser_show
issue: #202The text was updated successfully, but these errors were encountered: