RSS/Atom feed Twitter
Site is read-only, email is disabled

Total bafflement

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Total bafflement Chris Moller 20 Aug 15:54
  Total bafflement David Gowers 20 Aug 17:50
Chris Moller
2006-08-20 15:54:23 UTC (over 18 years ago)

Total bafflement

I'm adding a hack to gimp text that lets the user set the alignment of a new created bit of text to something other than the upper left corner of the text extents. E.g., the user will be able to set horizontal alignment to "center" and text entered thereafter will be horizontally centered on the point where text entry was started.

Currently, gimptextoption.c uses gimp_prop_enum_stock_box_new() to set up a row of little icons to let the user select left, center, right, or fill text justification. Just for consistency, I'd like to have the alignment options presented the same way, as a row of little icons.

But I can't figure out where gimp is storing the blasted icons!

Where does gimp_prop_enum_stock_box_new() get the images? Anyone Out There have a clue? At the moment, I'm using gimp_prop_enum_combo_box_new(), but that's not visually consistent with the stock_box stuff.

Thanks

David Gowers
2006-08-20 17:50:16 UTC (over 18 years ago)

Total bafflement

Stock icons are identified by their string. there is an .h file (gimpstock.h) somewhere that defines aliases like GIMP_STOCK_RESET, GIMP_STOCK_LINE_SPACING

The actual mechanism for icons is more to do with GTK. Gimp registers stock icons, then whenever you specify something like GIMP_STOCK_RESET, the icon that Gimp registered before is used (I think stock IDs can also be associated with text, as in the reset buttons showing an icon and also the text 'Reset' -- but I don't fully understand that.

So if you want to add an icon, you would need to register it, provide the image, and maybe modify the makefile.in file so that 'make install' will include your icon when installing GIMP.

Just getting a stockbox matching the others should be simple, anyway.. look at libgimpwidgets/gimppropwidgets.h: third parameter is 'stock_prefix' -- compare the values used here to the ones in gimpstock.h. It's fairly clear why prefixes are used in the case of enums.

On 8/20/06, Chris Moller wrote:

I'm adding a hack to gimp text that lets the user set the alignment of a new created bit of text to something other than the upper left corner of the text extents. E.g., the user will be able to set horizontal alignment to "center" and text entered thereafter will be horizontally centered on the point where text entry was started.

I appreciate that. The current behaviour mainly makes sense for left-justified text..
It might even make sense for right-justified text to fill to the left(with the text moving left as you type.)

Currently, gimptextoption.c uses gimp_prop_enum_stock_box_new() to set up a

row of little icons to let the user select left, center, right, or fill text justification. Just for consistency, I'd like to have the alignment options presented the same way, as a row of little icons.

But I can't figure out where gimp is storing the blasted icons!

Where does gimp_prop_enum_stock_box_new() get the images? Anyone Out There have a clue? At the moment, I'm using gimp_prop_enum_combo_box_new(), but that's not visually consistent with the stock_box stuff.

Thanks

Hope that helps.