Re: Why are signal names strings and not enums?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yes, but in that case how would you deal with custom signals, e.g. the ones you implement for your own custom widgets?

It’s pretty much impossible for an extendable API.

Stefan Salewski <mail@xxxxxxxxxxxx> ezt írta (időpont: 2017. okt. 6., P, 13:24):
We are using code like

   g_signal_connect(G_OBJECT(btn), "clicked", 
      G_CALLBACK(gtk_main_quit), G_OBJECT(window));

  g_signal_connect(G_OBJECT(window), "destroy", 
      G_CALLBACK(gtk_main_quit), NULL);

Why strings and not enums for clicked and destroy parameter?

I wondered about that myself when I started with GTK ten years ago and
recently someone suggested to do not use strings for my Nim GTK
bindings.

Well, strings have the disadvantage that undefined signal names are not
discovered during compile process.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux