8000 Removed created icons in favour of pre-existing ones. Tried, unsucces… · matplotlib/matplotlib@c382f60 · GitHub
[go: up one dir, main page]

Skip to content

Commit c382f60

Browse files
pelsonpelson
authored andcommitted
Removed created icons in favour of pre-existing ones. Tried, unsuccessfully to implement icon in wx.
1 parent 25df1bb commit c382f60

File tree

7 files changed

+20
-1381
lines changed

7 files changed

+20
-1381
lines changed

examples/api/mpl_icon.py

Lines changed: 0 additions & 82 deletions
This file was deleted.

lib/matplotlib/backends/backend_wx.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from __future__ import division, print_function
22
"""
3-
4-
backend_wx.py
5-
63
A wxPython backend for matplotlib, based (very heavily) on
74
backend_template.py and backend_gtk.py
85
@@ -18,14 +15,17 @@
1815
1916
"""
2017

21-
cvs_id = '$Id$'
18+
import sys
19+
import os
20+
import os.path
21+
import math
22+
import StringIO
23+
import weakref
24+
import warnings
2225

23-
24-
import sys, os, os.path, math, StringIO, weakref, warnings
2526
import numpy as np
2627

2728

28-
2929
# Debugging settings here...
3030
# Debug level set here. If the debug level is less than 5, information
3131
# messages (progressively more info for lower value) are printed. 8000 In addition,
@@ -188,7 +188,6 @@ def __init__(self, parent, *args, **kwargs):
188188

189189
# Unbinding causes Wx to stop for some reason. Disabling for now.
190190
# def __del__(self):
191-
# import wx
192191
# TimerBase.__del__(self)
193192
# self.parent.Bind(wx.EVT_TIMER, None, self._timer)
194193

@@ -410,7 +409,6 @@ def get_gc(self):
410409
assert self.gc != None, "gc must be defined"
411410
return self.gc
412411

413-
414412
def get_wx_font(self, s, prop):
415413
"""
416414
Return a wx font. Cache instances in a font dictionary for
@@ -448,14 +446,14 @@ def get_wx_font(self, s, prop):
448446

449447
return font
450448

451-
452449
def points_to_pixels(self, points):
453450
"""
454451
convert point measures to pixes using dpi and the pixels per
455452
inch of the display
456453
"""
457454
return points*(PIXELS_PER_INCH/72.0*self.dpi/72.0)
458455

456+
459457
class GraphicsContextWx(GraphicsContextBase):
460458
"""
461459
The graphics context provides the color, line styles, etc...
@@ -627,6 +625,7 @@ def get_wxcolour(self, color):
627625
a *= 255
628626
return wx.Colour(red=int(r), green=int(g), blue=int(b), alpha=int(a))
629627

628+
630629
class FigureCanvasWx(FigureCanvasBase, wx.Panel):
631630
"""
632631
The FigureCanvas contains the figure and does event handling.
@@ -1421,7 +1420,7 @@ def _create_wx_app():
14211420
# retain a reference to the app object so it does not get garbage
14221421
# collected and cause segmentation faults
14231422
_create_wx_app.theWxApp = wxapp
1424-
1423+
14251424

14261425
def draw_if_interactive():
14271426
"""
@@ -1512,6 +1511,15 @@ def __init__(self, num, fig):
15121511
self.Fit()
15131512

15141513
self.canvas.SetMinSize((2, 2))
1514+
1515+
# give the window a matplotlib icon rather than the stock one.
1516+
# This is not currently working on Linux and is untested elsewhere.
1517+
#icon_path = os.path.join(matplotlib.rcParams['datapath'],
1518+
# 'images', 'matplotlib.png')
1519+
#icon = wx.IconFromBitmap(wx.Bitmap(icon_path))
1520+
# for xpm type icons try:
1521+
#icon = wx.Icon(icon_path, wx.BITMAP_TYPE_XPM)
1522+
#self.SetIcon(icon)
15151523

15161524
self.figmgr = FigureManagerWx(self.canvas, num, self)
15171525

@@ -1559,15 +1567,14 @@ def Destroy(self, *args, **kwargs):
15591567
wxapp.Yield()
15601568
return True
15611569

1570+
15621571
class FigureManagerWx(FigureManagerBase):
15631572
"""
15641573
This class contains the FigureCanvas and GUI frame
15651574
15661575
It is instantiated by GcfWx whenever a new figure is created. GcfWx is
15671576
responsible for managing multiple instances of FigureManagerWx.
15681577
1569-
NB: FigureManagerBase is found in _pylab_helpers
1570-
15711578
public attrs
15721579
15731580
canvas - a FigureCanvasWx(wx.Panel) instance
@@ -1599,7 +1606,6 @@ def destroy(self, *args):
15991606
DEBUG_MSG("destroy()", 1, self)
16001607
self.frame.Destroy()
16011608
#if self.tb is not None: self.tb.Destroy()
1602-
import wx
16031609
#wx.GetApp().ProcessIdle()
16041610
wx.WakeUpIdle()
16051611

@@ -1939,11 +1945,6 @@ def set_history_buttons(self):
19391945

19401946
class NavigationToolbarWx(wx.ToolBar):
19411947
def __init__(self, canvas, can_kill=False):
1942-
"""
1943-
figure is the Figure instance that the toolboar controls
1944-
1945-
win, if not None, is the wxWindow the Figure is embedded in
1946-
"""
19471948
wx.ToolBar.__init__(self, canvas.GetParent(), -1)
19481949
DEBUG_MSG("__init__()", 1, self)
19491950
self.canvas = canvas
-5.63 KB
Binary file not shown.
-47 KB
Binary file not shown.
-15.7 KB
Binary file not shown.

lib/matplotlib/mpl-data/images/logo.ppm

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0