tk

Exit Tks mainloop in Python?

I'm writing a slideshow program with Tkinter, but I don't know how to go to the next image without binding a key. import os, sys import Tkinter import Image, ImageTk import time root = Tkinter.Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, h)) root.focus_set() r...

Background color for Tk in Python

I'm writing a slideshow program with Tkinter, but I don't know how to change the background color to black instead of the standard light gray. How can this be done? import os, sys import Tkinter import Image, ImageTk import time root = Tkinter.Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.overrideredirect(1) root...

[PERL Tk] printing Line number in Text widget

I use the following code for printing the line number in a Text widget: my $c = 0; my $r = 0; $txt = $mw->Text( -background => 'white', -width => 400, -height => 300, -selectbackground => 'skyblue', -insertwidth => 5, -borderwidth => 3, -highlightcolor ...

How do you get the children of a Tk Widget?

How do tell a Tk widget to tell me what (or who as the case may be) its children are? Is there a command for this? For example given a canvas widget .cvs with a label, a button and other adornments ... How do interrogate the canvas? ...

How do I best handle a needed patch for Perl/Tk?

I am making a change to Perl/Tk for an application that has its own resident Perl and modules installation (so we can drop the app in and go). I've found a problem I am experiencing that I just stumbled on what seems to be the patch I need here: http://osdir.com/ml/lang.perl.tk/2004-10/msg00030.html Bug confirmed. Here's the patc...

Is there a workaround to the disappearing Perl/Tk text widget scrollbar for right justified content?

I've come across a bug I believe in Perl/Tk 804.027 Text Widget (using Scrollable('ROText')). When I add a tag that selects all and apply the configuration change to justify to the right, the scrollbars do not show up. If I comment out the tagConfigure where I justify to the right, the scrollbars come back. Does anyone have a workaround...

How can I close a window in Perl/Tk?

In my Perl/Tk script I have opened two windows. After a specific button click I want to close one of them. How can I do that? Here's what I have so far: $main = new MainWindow; $sidebar = $main->Frame(-relief => "raised", -borderwidth => 2) ->pack (-side=>"left" , -anchor ...

Trying to install MinGW and Tk for Perl on Windows 7

So... I have been trying to get this working for several weeks now. I can install MinGW through the .exe, but no-matter what I do I can't seem to get make support or ppm install MinGW to work in such a way that my compilation of Tk-804.029 will correctly use the 'make' command. (Installing a Perl Module: perl MakeFile.PL - Works fine ...

including tk.h and tcl.h in c program

hi, i am working on an ubuntu system. My aim is to basically make an IDE in C language using GUI tools from TCL/TK. I installed tcl 8.4, tk8.4, tcl8.4-dev, tk8.4-dev and have the tk.h and tcl.h headers file in my system. But, when I am running a basic hello world program it's showing a hell lot of errors. #include "tk.h" #include "stdio...

How to use option key combinations in a text widget

On a Mac I can get an a-grave character by typing Option+` followed by a - voilà ! When using a text widget however, the Option+` combination causes wish to quit unexpectedly. Is there a way to get around this? Is there a binding that will take care of this, and allow me to insert a character into the text. The language I am dealing wi...

Tcl/Tk: Maximize window / determine if window is maximized?

Can I find out if my toplevel window is maximized, and can I maximize it programmatically? I am using R's tcltk package 8.5 on Windows XP. The reason for the question is: I want to enforce a <Visibility> event by calling first withdraw and then deiconify. However, if the window was maximized before these two function calls, it is not af...

multiple comboboxes in R using tcltk

I have been trying to define multiple combo boxes in R using the tcltk package but to no avail. I am using the below code. My inspiration was here, however I can't seem to just label them comboBox1, comboBox2, etc... so I decided to try and set their output values into a vector... but their output values don't make any sense to me... a...

How to create a status line with ttk?

How do you create your status line at the bottom of your window? An inactive entry does not look very nice. What other options are there? Is possible to integrate a progress bar which is visible only on demand? (I am using tk and ttk from within R.) EDIT: Now here is my second version, which works fine for me, but I would like to disp...

How can I get the text in the Perl/Tk Text widget?

I have written a script that gets a file name and insert the file content to a Text widget. Now when I close the script window, I need it to write the text onto the Unix screen. How can I get the Text widget content? My text widget insertion sorce code is: open(FILE, $file_name); foreach my $line (<FILE>) { $text->insert('end', $l...

Create new perl/tk window that will automatically close after 1sec

Hi, I want to add a new widget to my script that will open a new window with text and will close automatically after 1sec. how can I do it ? ...

How do I enable a disabled context menu item when selection happens in a Perl Tk gui?

For example in the following script: use Tk; my $mw = new MainWindow; my $t = $mw->Scrolled("Text")->pack; my $popup = $mw->Menu( -menuitems => [ [ Button => 'Copy Selected', -state => "disabled", -command => sub {$t->clipboardColumnCopy} ], ] ); $t->menu($popup); MainL...

What is a good way to show different content dynamically (in Tcl/Tk)?

I have a set of radiobuttons (say, with choices 1 and 2) and need to show some widget based off of the user's choice. For example, if they chose 1, I would show them a labelframe with several radiobuttons; whereas, if they chose 2, I would show them a labelframe with some buttons. In either case, the resulting content would be shown in t...

How to find the mouse cursor index

Hi I wrote a script with the "undotext" widget, and I'm looking for a way to get the line index of the palce where the mouse cursor is standing. and similarly when the user has select part of the line. ...

Fullscreen mode with Tk

Is it possible to create some kind of fullscreen mode (e.g. no window title bar) in Tk applications? ...

Why -editable is not working in iwidgets (tcl/tk)?

I was trying to use iwidgets in some GUI and I want to make combobox non-editable. As per activetcl documentation, the -editable option is mentioned for combobox and yet it is not working. combobox $frm_sat1.c2 \ -textvariable [itcl::scope type] \ -state normal -entries {"1 opt" "2 opt"} -editable 0; help me! ...