|
|
BUT: It doesn't rescale when I resize the widget. So I guess I do still need a resize() method to handle that still?
OK, tried this over lunch - here's an example as a fluid file, seems to work for me at any rate... You'll need to provide a SVG image called "test_img.svg" but other than that should just work.
fluid -c test1.fl fltk-config --use-images --compile test1.cxx
====================== test1.fl ===
# data file for the Fltk User Interface Designer (fluid) version 1.0400 header_name {.h} code_name {.cxx} decl {\#include <FL/Fl_SVG_Image.H>} {public global }
decl {\#include <FL/Fl_Box.H>} {public global }
data svg3 {private local filename {../img/test_img.svg} textmode }
class svg_rsz {open : {public Fl_Box} } { Function {svg_rsz(Fl_SVG_Image *svg2, int X, int Y, int W, int H, const char* L=0) : Fl_Box(X,Y,W,H,L)} { comment Constructor open } { code {svg = svg2; svg->resize(w(),h()); image(svg);} {} } Function {resize(int x, int y, int w, int h)} { comment {A resize method} open return_type void } { code {Fl_Box::resize(x,y,w,h); svg->resize(this->w(),this->h());} {} } decl {Fl_SVG_Image *svg;} {private local } }
Function {} {open } { code {Fl_SVG_Image *svg2 = new Fl_SVG_Image(NULL, svg3);} {} code {svg_rsz *boxA = NULL;} {selected } Fl_Window main_win {open private xywh {882 285 249 221} type Double resizable code0 {boxA = new svg_rsz(svg2, 15, 15, 180, 180);} visible } {} }
===== end ====
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/bbb5d481-2742-4177-8305-6ba596864682n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |