From: Gary P. <pa...@in...> - 2004-03-13 13:18:34
|
I've been poking aroung a bit trying to see if I can locate my plots in a frame in my own Tkinter GUI rather than a stand-alone window. It looks like it might be possible if I can, for example, extract the frame instance from a TkAgg plot (or something like that) Can anyone comment or suggest a route? -gary |
From: John H. <jdh...@ac...> - 2004-03-16 12:51:39
|
>>>>> "Gary" == Gary Pajer <pa...@in...> writes: Gary> I've been poking aroung a bit trying to see if I can locate Gary> my plots in a frame in my own Tkinter GUI rather than a Gary> stand-alone window. Gary> It looks like it might be possible if I can, for example, Gary> extract the frame instance from a TkAgg plot (or something Gary> like that) Gary> Can anyone comment or suggest a route? Todd, is this easily doable? Could you write an embedding_in_tk.py example along the lines of embedding_in_gtk and embedding_in_wx? The FigureCanvas derived instance in backend_* is meant to be a widget you could plug into a GUI, but I notice you took a different tack in backend_tkagg. The idea behind this is that users may want to embed a figure as part of a GUI window, eg in a widget container, without necessarily bringing the toolbar along or using the whole window. Would this be an easy refactoring of backend_tkagg? Thanks, JDH |
From: Todd M. <jm...@st...> - 2004-03-16 19:36:12
|
On Tue, 2004-03-16 at 07:29, John Hunter wrote: > >>>>> "Gary" == Gary Pajer <pa...@in...> writes: > > Gary> I've been poking aroung a bit trying to see if I can locate > Gary> my plots in a frame in my own Tkinter GUI rather than a > Gary> stand-alone window. > > Gary> It looks like it might be possible if I can, for example, > Gary> extract the frame instance from a TkAgg plot (or something > Gary> like that) > > Gary> Can anyone comment or suggest a route? > First an apology. I didn't see this until late yesterday when Perry alerted me. I wasn't subscribed to matplotlib-users. > Todd, is this easily doable? Frankly, I'm not sure. I'll try to work it out this afternoon. I imagine if it's possible in GTK it's possible in Tk. > Could you write an embedding_in_tk.py > example along the lines of embedding_in_gtk and embedding_in_wx? I'll try and let you know. > > The FigureCanvas derived instance in backend_* is meant to be a widget > you could plug into a GUI, but I notice you took a different tack in > backend_tkagg. The idea behind this is that users may want to embed a > figure as part of a GUI window, eg in a widget container, without > necessarily bringing the toolbar along or using the whole window. > Would this be an easy refactoring of backend_tkagg? We'll see. Regards, Todd -- Todd Miller <jm...@st...> |
From: Todd M. <jm...@st...> - 2004-03-17 16:41:30
|
On Tue, 2004-03-16 at 07:29, John Hunter wrote: > >>>>> "Gary" == Gary Pajer <pa...@in...> writes: > > Gary> I've been poking aroung a bit trying to see if I can locate > Gary> my plots in a frame in my own Tkinter GUI rather than a > Gary> stand-alone window. > > Gary> It looks like it might be possible if I can, for example, > Gary> extract the frame instance from a TkAgg plot (or something > Gary> like that) > > Gary> Can anyone comment or suggest a route? > > Todd, is this easily doable? As we all hoped, this was easy and is now in CVS. I refactored FigureManagerTkAgg and added FigureCanvasTkAgg to support the new functionality. FigureCanvasTkAgg defines get_tk_widget() to return whatever tk widget is used to implement it. Currently it returns a Tk canvas but I thought it would be best not to assume that will always be the case. Like other Tk widgets, FigureCanvasTkAgg wants to be told who its parent widget (master) is at construction time. > Could you write an embedding_in_tk.py > example along the lines of embedding_in_gtk and embedding_in_wx? This is also in CVS. > Regards, Todd > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Todd Miller <jm...@st...> |
From: John H. <jdh...@ac...> - 2004-03-17 16:47:02
|
>>>>> "Todd" == Todd Miller <jm...@st...> writes: Todd> This is also in CVS. Nice work! In a quick test, the only thing I noticed is that the figure window does not resize when embedded but does on a normal plot. I don't know if this is a bug or a feature :-). In backend_gtk, I handle the configure event in the FigureCanvas. Gary, if you need a src snapshot (the regular CVS mirrors can lag sometimes by a couple of days), let me know. JDH |
From: Todd M. <jm...@st...> - 2004-03-17 19:19:20
|
On Wed, 2004-03-17 at 11:24, John Hunter wrote: > >>>>> "Todd" == Todd Miller <jm...@st...> writes: > > Todd> This is also in CVS. > > Nice work! > > In a quick test, the only thing I noticed is that the figure window > does not resize when embedded but does on a normal plot. I don't know > if this is a bug or a feature :-). I implemented this since you brought it up and I think the new way qualifies as a feature. The widget packing can be used to drive either kind of behavior: resize-able or not-resize-able. The demo now resizes. Regards, Todd > In backend_gtk, I handle the > configure event in the FigureCanvas. > > Gary, if you need a src snapshot (the regular CVS mirrors can lag > sometimes by a couple of days), let me know. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Todd Miller <jm...@st...> |
From: Gary P. <pa...@in...> - 2004-03-17 20:53:40
|
Thanks very much, guys! -Gary ----- Original Message ----- From: "Todd Miller" <jm...@st...> To: "John Hunter" <jdh...@ni...> Cc: "Gary Pajer" <pa...@in...>; <mat...@li...> Sent: Wednesday, March 17, 2004 11:38 AM Subject: Re: [Matplotlib-users] TkAgg in a Tkinter GUI frame? > On Tue, 2004-03-16 at 07:29, John Hunter wrote: > > >>>>> "Gary" == Gary Pajer <pa...@in...> writes: > > > > Gary> I've been poking aroung a bit trying to see if I can locate > > Gary> my plots in a frame in my own Tkinter GUI rather than a > > Gary> stand-alone window. > > > > Gary> It looks like it might be possible if I can, for example, > > Gary> extract the frame instance from a TkAgg plot (or something > > Gary> like that) > > > > Gary> Can anyone comment or suggest a route? > > > > Todd, is this easily doable? > > As we all hoped, this was easy and is now in CVS. I refactored > FigureManagerTkAgg and added FigureCanvasTkAgg to support the new > functionality. FigureCanvasTkAgg defines get_tk_widget() to return > whatever tk widget is used to implement it. Currently it returns a Tk > canvas but I thought it would be best not to assume that will always be > the case. Like other Tk widgets, FigureCanvasTkAgg wants to be told > who its parent widget (master) is at construction time. > > > Could you write an embedding_in_tk.py > > example along the lines of embedding_in_gtk and embedding_in_wx? > > This is also in CVS. > > > > Regards, > Todd > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- > Todd Miller <jm...@st...> > |
From: Todd M. <jm...@st...> - 2004-03-17 21:57:30
|
On Wed, 2004-03-17 at 15:51, Gary Pajer wrote: > Thanks very much, guys! > > -Gary > You're welcome! Anyone interested in TkAgg that hasn't updated since I last announced changes should do so. JDH discovered that the toolbar was broken and I fixed it about an hour or so ago. Regards, Todd > > ----- Original Message ----- > From: "Todd Miller" <jm...@st...> > To: "John Hunter" <jdh...@ni...> > Cc: "Gary Pajer" <pa...@in...>; <mat...@li...> > Sent: Wednesday, March 17, 2004 11:38 AM > Subject: Re: [Matplotlib-users] TkAgg in a Tkinter GUI frame? > > > > On Tue, 2004-03-16 at 07:29, John Hunter wrote: > > > >>>>> "Gary" == Gary Pajer <pa...@in...> writes: > > > > > > Gary> I've been poking aroung a bit trying to see if I can locate > > > Gary> my plots in a frame in my own Tkinter GUI rather than a > > > Gary> stand-alone window. > > > > > > Gary> It looks like it might be possible if I can, for example, > > > Gary> extract the frame instance from a TkAgg plot (or something > > > Gary> like that) > > > > > > Gary> Can anyone comment or suggest a route? > > > > > > Todd, is this easily doable? > > > > As we all hoped, this was easy and is now in CVS. I refactored > > FigureManagerTkAgg and added FigureCanvasTkAgg to support the new > > functionality. FigureCanvasTkAgg defines get_tk_widget() to return > > whatever tk widget is used to implement it. Currently it returns a Tk > > canvas but I thought it would be best not to assume that will always be > > the case. Like other Tk widgets, FigureCanvasTkAgg wants to be told > > who its parent widget (master) is at construction time. > > > > > Could you write an embedding_in_tk.py > > > example along the lines of embedding_in_gtk and embedding_in_wx? > > > > This is also in CVS. > > > > > > > Regards, > > Todd > > > > > > > > > > > ------------------------------------------------------- > > > This SF.Net email is sponsored by: IBM Linux Tutorials > > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > > GenToo technologies. Learn everything from fundamentals to system > > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > > _______________________________________________ > > > Matplotlib-users mailing list > > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- > > Todd Miller <jm...@st...> > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Todd Miller <jm...@st...> |