# Problem with Tk::Tile::Dialog#client\_frame

**URL:** <https://www.ruby-forum.com/t/problem-with-tk-dialog-client-frame/89613>\
**Category:** Ruby\
**Created:** [March 21, 2007, 5:09pm UTC](https://www.ruby-forum.com/t/problem-with-tk-dialog-client-frame/89613 "2007-03-21T17:09:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caefer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@caefer](https://www.ruby-forum.com/u/caefer)\
**Post date:** [March 21, 2007, 5:09pm UTC](https://www.ruby-forum.com/t/problem-with-tk-dialog-client-frame/89613/1 "2007-03-21T17:09:50Z")

</div>

Hi

I’m trying to write a gui program using Ruby and Tk/Tile.

I’d like to do something like:

```
require 'tk'
require 'tkextlib/tile'

d = Tk::Tile::Dialog.new(:type=>'okcancel', :message=>'Enter name:')
Tk::Tile::Entry.new(d.client_frame).pack
d.show

```

- but I get:

RuntimeError: wrong # args: should be “::ttk::dialog::clientframe dlg”  
from /usr/local/lib/ruby/1.8/tk.rb:1694:in `_invoke_without_enc' from /usr/local/lib/ruby/1.8/tk.rb:1694:in`\_ip\_invoke\_core’  
from /usr/local/lib/ruby/1.8/tk.rb:1730:in `_tk_call_core' from /usr/local/lib/ruby/1.8/tk.rb:1758:in`tk\_call\_without\_enc’  
from /usr/local/lib/ruby/1.8/tkextlib/tile/dialog.rb:54:in  
`client\_frame’

It seems that Tk::Tile::Dialog#client\_frame launches an incorrect  
command  
against tcl.

It works at the Tcl/Tk level. This script (which I’ve constructed with a  
considerable effort, as I don’t speak tcl):

```
package require tile
ttk::dialog .dlg -type okcancel -message "Enter name:"
set cf [ttk::dialog::clientframe .dlg]
ttk::entry $cf.entry
pack $cf.entry

```

does what I want. (Sorry for posting tcl on this list :-))

Could it be a version problem?  
I’m running ruby 1.8.6, Tcl8.5a5, Tk8.5a5, Tile-0.7.8. All compiled from  
sources on a debian unstable box.

br. Christian S.

---

<div class="post-metadata">

**Author:** ![caefer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@caefer](https://www.ruby-forum.com/u/caefer)\
**Post date:** [March 25, 2007, 8:52pm UTC](https://www.ruby-forum.com/t/problem-with-tk-dialog-client-frame/89613/2 "2007-03-25T20:52:02Z")

</div>

Hi

Still trying to call Tk::Tile::Dialog#client\_frame and still having  
problems.

Resumé:  
When I do:

```
Tk::TIle::Dialog.new(type=>'okcancel').client_frame

```

I get:

/usr/local/lib/ruby/1.8/tk.rb:1694:in `_invoke_without_enc': wrong # args: should be "::ttk::dialog::clientframe dlg" (RuntimeError) from /usr/local/lib/ruby/1.8/tk.rb:1694:in`\_ip\_invoke\_core’  
from /usr/local/lib/ruby/1.8/tk.rb:1730:in `_tk_call_core' from /usr/local/lib/ruby/1.8/tk.rb:1758:in`tk\_call\_without\_enc’  
from /usr/local/lib/ruby/1.8/tkextlib/tile/dialog.rb:54:in  
`client\_frame’  
from ./dialogtst.rb:36

I thought I had it figured out from looking at

```
Tk::Tile::TNotebook#enable_traversal

```

That method calls

tk\_call\_without\_enc(’::ttk:📓:enableTraversal’, @path)

- so I redefined Tk::Tile::Dialog#client\_frame as:

class Tk::Tile::Dialog  
def client\_frame  
window(tk\_call\_without\_enc(’::ttk::dialog::clientframe’, @path))  
end  
end

and do:

Dialog.new(:type=\>‘okcancel’).clientframe

- but then I get:

/usr/local/lib/ruby/1.8/tk.rb:1694:in `_invoke_without_enc': bad window path name ".w00000.f" (RuntimeError) from /usr/local/lib/ruby/1.8/tk.rb:1694:in`\_ip\_invoke\_core’  
from /usr/local/lib/ruby/1.8/tk.rb:1730:in `_tk_call_core' from /usr/local/lib/ruby/1.8/tk.rb:1758:in`tk\_call\_without\_enc’  
from ./dialogtst.rb:32:in `client\_frame’  
from ./dialogtst.rb:37

Now, I know that the path of the dialog must be ‘.w00000’, so somewhere  
‘.f’  
is appended. Does anybody know where an why?

My appologies for persisting with this question, by I’m really stuck.

br. Christian S.

Onsdag den 21. Marts 2007 skrev Christian S.:

---

<div class="post-metadata">

**Author:** ![caefer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@caefer](https://www.ruby-forum.com/u/caefer)\
**Post date:** [April 3, 2007, 12:14pm UTC](https://www.ruby-forum.com/t/problem-with-tk-dialog-client-frame/89613/3 "2007-04-03T12:14:07Z")

</div>

From: Christian S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Subject: Re: Problem with Tk::Tile::Dialog#client\_frame  
Date: Mon, 26 Mar 2007 03:51:19 +0900  
Message-ID: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Still trying to call Tk::Tile::Dialog#client\_frame and still having problems.  
> (snip)
> 
> - but then I get:
> 
> /usr/local/lib/ruby/1.8/tk.rb:1694:in `_invoke_without_enc': bad window path name ".w00000.f" (RuntimeError) from /usr/local/lib/ruby/1.8/tk.rb:1694:in `\_ip\_invoke\_core’  
> from /usr/local/lib/ruby/1.8/tk.rb:1730:in `_tk_call_core' from /usr/local/lib/ruby/1.8/tk.rb:1758:in `tk\_call\_without\_enc’  
> from ./dialogtst.rb:32:in `client\_frame’  
> from ./dialogtst.rb:37

The real widget of Tk::Tile::Dialog is generated  
when “show” method is called.  
Before that, “client\_frame” method returns an invalid widget path.

It is the specificaion of the widget.  
But, I can understand that it is inconvenient.  
I’ll consider better ways.
