# Tk GUI works not like expected ? Widget appears only for 1 second!

**URL:** <https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420>\
**Category:** General Usage\
**Tags:** guis\
**Created:** [January 16, 2018, 8:55pm UTC](https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420 "2018-01-16T20:55:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon48172955](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@anon48172955](https://discourse.julialang.org/u/anon48172955)\
**Post date:** [January 16, 2018, 8:55pm UTC](https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420/1 "2018-01-16T20:55:38Z")

</div>

using Tk  
Messagebox(title=“title” , message=“message”)

The code works.  
Message - Warning could not import Base.Text into Tk  
###########################################

Example 2 code for Tk:

using Base.Graphics  
using Cairo  
using Tk

win = Toplevel(“Test” , 400, 200)  
c = Canvas(win)  
pack(c, expand=true, fill=“both”)

#sleep(20)

Compiling takes a longer time.  
Message appear such the above code ! Could not import Base.text.  
And the Tk Window only appears for 1 seconds and flows away.  
How to fix that in the code.  
I want to make a Main Window that stays right long on screen.

WBR  
MHE

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [January 17, 2018, 6:31am UTC](https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420/2 "2018-01-17T06:31:04Z")

</div>

I just ran the 2 example put into a file (replace Base.Graphics with Graphics only, take comment from sleep) with julia 0.6.2. I don’t see longer compilation time and window stays as long as sleep.  
The errors you see might be version and computer specific.
