<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MessageBox Not getting focus when run in ArcMap in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319820#M24857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found a work around by not using tkMessageBox.&amp;nbsp; Instead I created a dialog class that does that same job.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Mar 2012 13:14:30 GMT</pubDate>
    <dc:creator>WilliamIde</dc:creator>
    <dc:date>2012-03-23T13:14:30Z</dc:date>
    <item>
      <title>MessageBox Not getting focus when run in ArcMap</title>
      <link>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319819#M24856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have been working on a system that is not connected to this net work so I am going to have type a shorted version &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I create a app window a few buttons and then I do some logic.&amp;nbsp; Then I ask a question in a askquestion MessageBox.&amp;nbsp; The problem is this code works when I run it in IDEL.&amp;nbsp; But when I run as a script from ArcMAP the askquestion MessageBox doesn't get mouse focus.&amp;nbsp; So the user can't say yes or no.&amp;nbsp; Why no focus?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
from arcpy import env

import Tkinter as tk
import tkMessageBox


root = tk.Tk()

maintitle = tk.Label(root,"Add things to the list")
button1 = tk.Button(root,text="Help",commend=help_call)

buttonq = tk.Button(root,text="Quit",commend=quit_calll)


## do some logic in arcpy

found_one = 0

for field in fieldlist:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if field[0:3] == "RM_"&amp;nbsp;&amp;nbsp; # see is any fields start with RM_
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; found_one += 1

if found_one == 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lbAnswer = tkMessageBox.askquestion("No RM found"," not RM_ fields found create them?")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (lbAnswer == "yes":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; createthe_rm_fields(inputfile)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; root.destroy()

root.mainloop()

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:27:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319819#M24856</guid>
      <dc:creator>WilliamIde</dc:creator>
      <dc:date>2012-03-22T15:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: MessageBox Not getting focus when run in ArcMap</title>
      <link>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319820#M24857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found a work around by not using tkMessageBox.&amp;nbsp; Instead I created a dialog class that does that same job.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 13:14:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319820#M24857</guid>
      <dc:creator>WilliamIde</dc:creator>
      <dc:date>2012-03-23T13:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: MessageBox Not getting focus when run in ArcMap</title>
      <link>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319821#M24858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still no fix for this in ArcGIS 10.5, it appears.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 12:57:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/messagebox-not-getting-focus-when-run-in-arcmap/m-p/319821#M24858</guid>
      <dc:creator>GwenLaSelva</dc:creator>
      <dc:date>2017-03-22T12:57:53Z</dc:date>
    </item>
  </channel>
</rss>

