Hi,
Currently UIUtilsFuncs contain ui_path_box_new(), so a file-chooser-dialog button can be created programatically in a plugin. But there's no ui_setup_open_button_callback(), so it's impossible to load such a button from a .glade file and setup it, as in Geany.
geanyprj uses ui_path_box_new(), and other plugins (saveactions, spellcheck, debugger, ...) create file-chooser-dialog buttons manually, so they seem common. I'm writing a new plugin, and would prefer to use .glade for the interface as much as possible (and practical).
On 12-04-05 11:56 AM, Dimitar Zhekov wrote:
Hi,
Currently UIUtilsFuncs contain ui_path_box_new(), so a file-chooser-dialog button can be created programatically in a plugin. But there's no ui_setup_open_button_callback(), so it's impossible to load such a button from a .glade file and setup it, as in Geany.
geanyprj uses ui_path_box_new(), and other plugins (saveactions, spellcheck, debugger, ...) create file-chooser-dialog buttons manually, so they seem common. I'm writing a new plugin, and would prefer to use .glade for the interface as much as possible (and practical).
IMO, all this path box stuff should be deprecated in favour of the widget provided by the toolkit (GtkFileChooserButton). Using custom stuff like this makes Geany "non-standard" amongst other GTK+ programs and it doesn't provide the flexibility of the already provided widget, namely being a real GtkWidget and integration with Glade.
On the other hand, I also wouldn't be opposed to a proper implementation of a real custom GtkWidget subclass (ex. GeanyPathBox) that can be used in Glade and otherwise conveniently, since I tend to find the text box next to the button to be more user-friendly than the widget currently provided by the toolkit for this purpose.
My $0.02, having thought about this before while porting to Glade and having previously written a GeanyPathBox widget for this use.
Cheers, Matthew Brush
On 6 April 2012 06:03, Matthew Brush mbrush@codebrainz.ca wrote:
On 12-04-05 11:56 AM, Dimitar Zhekov wrote:
Hi,
Currently UIUtilsFuncs contain ui_path_box_new(), so a file-chooser-dialog button can be created programatically in a plugin. But there's no ui_setup_open_button_callback(), so it's impossible to load such a button from a .glade file and setup it, as in Geany.
geanyprj uses ui_path_box_new(), and other plugins (saveactions, spellcheck, debugger, ...) create file-chooser-dialog buttons manually, so they seem common. I'm writing a new plugin, and would prefer to use .glade for the interface as much as possible (and practical).
IMO, all this path box stuff should be deprecated in favour of the widget provided by the toolkit (GtkFileChooserButton). Using custom stuff like this makes Geany "non-standard" amongst other GTK+ programs and it doesn't provide the flexibility of the already provided widget, namely being a real GtkWidget and integration with Glade.
On the other hand, I also wouldn't be opposed to a proper implementation of a real custom GtkWidget subclass (ex. GeanyPathBox) that can be used in Glade and otherwise conveniently, since I tend to find the text box next to the button to be more user-friendly than the widget currently provided by the toolkit for this purpose.
It would be fine to clean up, so long as the new version works on the oldest GTK we support.
Cheers Lex
My $0.02, having thought about this before while porting to Glade and having previously written a GeanyPathBox widget for this use.
Cheers, Matthew Brush _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Thu, 05 Apr 2012 13:03:20 -0700 Matthew Brush mbrush@codebrainz.ca wrote:
On 12-04-05 11:56 AM, Dimitar Zhekov wrote:
Hi,
Currently UIUtilsFuncs contain ui_path_box_new(), so a file-chooser-dialog button can be created programatically in a plugin. But there's no ui_setup_open_button_callback(), so it's impossible to load such a button from a .glade file and setup it, as in Geany. [...]
IMO, all this path box stuff should be deprecated in favour of the widget provided by the toolkit (GtkFileChooserButton). [...]
GtkFileChooserButton does not support SAVE. Is there any way to "choose" a non-existent file?..
On the other hand, I also wouldn't be opposed to a proper implementation of a real custom GtkWidget subclass (ex. GeanyPathBox) that can be used in Glade and otherwise conveniently, since I tend to find the text box next to the button to be more user-friendly than the widget currently provided by the toolkit for this purpose.
Neither would I, but GtkFileChooserButton is 3000 lines with the header file...
Anyway, currently Geany has ui_path_box_new(), which is accessible from plugins, and ui_setup_open_button_callback(), which is not. The former is inconvinient for a .glade interface, and with 2+ selectors it may be easier for to copy-paste the callback from, say, spellcheck, and use it with builder widgets...