asnaeb Posted September 22, 2017 Report Share Posted September 22, 2017 (edited) Ada yang pernah buat Arcgis python addin tapi untuk interface pakai Tk inter atau Wxpython atau Qt. Saya sudahcoba untuk Tkinter arcmap jadi crash, kalau pakai wxpython dialog ga bisa di close, jadi untuk interface sementara tetep pakai dialog arctoolbox, import arcpy import pythonaddins import wx class ToolClass2(object): """Implementation for DesignTool.tool (Tool)""" dlg= None def __init__(self): self.enabled = True self.shape = "NONE" self.cursor=3 def onMouseDownMap(self, x, y, button, shift): global laylist laylist=[] mxd=arcpy.mapping.MapDocument("CURRENT") for lyr in arcpy.mapping.ListLayers(mxd): laylist.append(lyr.name) del mxd if self.dlg is None: self.dlg = TestDialog() else: self.dlg.Show(True) return class TestDialog(wx.Frame): def __init__(self): wxStyle = wx.CAPTION | wx.RESIZE_BORDER | wx.MINIMIZE_BOX |wx.CLOSE_BOX | wx.SYSTEM_MENU | wx.CB_DROPDOWN wx.Frame.__init__(self, None, -1, "Main Menu", style=wxStyle, size=(330, 370)) self.SetMaxSize((330, 370)) self.SetMinSize((330, 370)) self.Bind(wx.EVT_CLOSE, self.OnClose) panel = wx.Panel(self, -1) wx.StaticText(panel, -1, "Choose Layer:", pos=(8,64)) self.LayerCombo = wx.ComboBox(panel, -1, value=laylist[1], pos=(180, 64), size=(120,21), choices=laylist) self.Bind(wx.EVT_BUTTON, self.OnSet, id=self.btnSet.GetId()) self.Show(True) def OnClose(self, event): self.Show(False) # self.Destroy() doesn't work def OnSet(self, event): Layerpath= str(self.LayerCombo.GetValue()) self.Show(False) app = wx.PySimpleApp() app.MainLoop() kalau ada share code samplenya dong, terimakasih Edited September 22, 2017 by asnaeb Quote Link to comment Share on other sites More sharing options...
Lurker Posted September 22, 2017 Report Share Posted September 22, 2017 pake arcgis berapa? https://gis.stackexchange.com/questions/212722/arcgis-crashing-with-tkinter ane bukan programmer jadi bantu2 searching aja untuk trouble sejenis intinya pada kompatibilitas untuk tkinter Quote Link to comment Share on other sites More sharing options...
asnaeb Posted September 25, 2017 Author Report Share Posted September 25, 2017 On 9/23/2017 at 3:31 AM, Lurker said: pake arcgis berapa? https://gis.stackexchange.com/questions/212722/arcgis-crashing-with-tkinter ane bukan programmer jadi bantu2 searching aja untuk trouble sejenis intinya pada kompatibilitas untuk tkinter dev di 10.5, usernya di 10.2.2 -10.5 makasih bang infonya, ternyata di wxpython sama tkinter kalau di arcgis emang kayanya ga bisa pake close button window. terimakasih 1 Quote Link to comment Share on other sites More sharing options...
Lurker Posted September 25, 2017 Report Share Posted September 25, 2017 ehehehe, nanti kalo dah ketemu solusinya n rampung pluginnya bisa cerita-cerita dimarih yah ehehehehe Quote Link to comment Share on other sites More sharing options...
freddy Posted September 19, 2019 Report Share Posted September 19, 2019 masuk/ gabung ke community.esri.com saja, disini dibahas tentang masalah python addon yang dimaksudkan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.