tk

.onLoad and gWidgets R - error in package build

僤鯓⒐⒋嵵緔 提交于 2019-12-24 17:57:45
问题 I've just finished making another R tool for a colleague and have done a simple gWidgets GUI to go with it. However I'm having trouble getting it to come up on package load: The error when building the package comes straight away in the .onLoad function, as soon as gwindow is called, on my system, even the following tidbit of code causes the error when I build the package binary - let alone my full gui: .onLoad <- function(...){ MainWindow <- gwindow("My GUI Window!", visible=TRUE) } call:

.onLoad and gWidgets R - error in package build

╄→尐↘猪︶ㄣ 提交于 2019-12-24 17:57:09
问题 I've just finished making another R tool for a colleague and have done a simple gWidgets GUI to go with it. However I'm having trouble getting it to come up on package load: The error when building the package comes straight away in the .onLoad function, as soon as gwindow is called, on my system, even the following tidbit of code causes the error when I build the package binary - let alone my full gui: .onLoad <- function(...){ MainWindow <- gwindow("My GUI Window!", visible=TRUE) } call:

Why in the world does Tkinter break using canvas.create_image?

梦想与她 提交于 2019-12-24 12:25:34
问题 I've got a python GUI app in the workings, which I intend to use on both Windows and Mac. The documentation on Tkinter isn't the greatest, and google-fu has failed me. In short, I'm doing: c = Canvas( master=frame, width=settings.WINDOW_SIZE[0], height=settings.WINDOW_SIZE[1], background=settings.CANVAS_COLOUR ) file = PhotoImage(file=os.path.join('path', 'to', 'gif')) c.create_bitmap(position, image=file) c.pack() root.mainloop() If I comment out the create_bitmap line, the app draws fine.

How to make the text in a Tk label selectable?

与世无争的帅哥 提交于 2019-12-24 08:28:47
问题 I'm creating labels in Tcl Tk, but their text is not selectable (for copy-paste). How do I make is selectable? I crate the labels using: set n 0 foreach t $list_of_labels { incrr n set lbl2 [label .prop_menu.main_frame.val_$n -text $t] grid $lbl2 ... } 回答1: You can't without taking a lot of the binding code from some other widget and applying it to your label. If you need this, you would be better taking an entry widget and making it look like a label. Something like: entry .e1 -textvar t

tkinter mac, minimize screen

独自空忆成欢 提交于 2019-12-24 03:46:05
问题 I'm using tkinter in python for mac. Simply put, I want to override the "minimize" button's functionality. I'm already overriding the "X" button functionality in this fashion: root = Tk() root.protocol('WM_DELETE_WINDOW', doClose) What I tried: I looked into the WM states and there is no WM_ICONIFY_WINDOW or WM_MINIMIZE_WINDOW . I also tried working with WM_SAVE_YOURSELF but couldn't catch any interrupt. what's the best known way of making tkinter do what I want when people hit "minimze"

php redis 操作手册

Deadly 提交于 2019-12-24 01:20:55
本篇文章给大家分享的内容是关于php redis 操作手册,有着一定的参考价值,有需要的朋友可以参考一下 redis手册推荐: redis中文手册下载地址: http://www.php.cn/xiazai/shouce/54 redis中文在线手册: http://www.php.cn/course/49.html String 类型操作 string是redis最基本的类型,而且string类型是二进制安全的。意思是redis的string可以包含任何数据。 比如jpg图片或者序列化的对象 $redis->set('key','TK'); $redis->set('number','1'); $redis->setex('key',5,'TK'); //设置有效期为5秒的键值 $redis->psetex('key',5000,'TK'); //设置有效期为5000毫秒(同5秒)的键值 $redis->setnx('key','XK'); //若键值存在返回false 不存在返回true $redis->delete('key'); 删除键值 可以传入数组 array('key1','key2')删除多个键 $redis->getSet('key','XK'); //将键key的值设置为XK, 并返回这个键值原来的值TK $ret = $redis->multi() /

How to update a Perl/Tk widget textvariable that is a moose attribute?

淺唱寂寞╮ 提交于 2019-12-24 00:56:05
问题 In Perl/Tk, one can define textvariables for widgets. It's a reference to some scalar that holds the value. Someone showed me how to use Moose attribute coercion to use Moose attributes as textvariable (cool!). This is how it works: subtype 'TkRef' => as 'ScalarRef'; coerce 'TkRef', from 'Str', via { my $r = $_; return \$r }; has 'some_val' => (is => 'rw', isa => 'TkRef', coerce => 1, default => 'default value'); $mw->Entry(-textvariable => $self->some_val); $mw->Label(-textvariable => $self-

How to move button outside of his parent with tkinter?

孤人 提交于 2019-12-23 19:26:40
问题 I'm currently trying to move a button by using drag and drop with tkinter. The problem is that when I'm trying to move my button, it's working but I can't move it outside his parent: I have a LabelFrame which contains several LabelFrame with buttons. I'm trying to drag and drop a button from a LabelFrame to the other one but when the button is going outside of his parent, it "disappears". I'm using the method "place" of the widget to move it during my drag. I'm not sure if my problem is

What are the disadvantages of the Perl Tk module?

≡放荡痞女 提交于 2019-12-23 18:47:37
问题 What are the disadvantages of the Tk module compared to other solutions to create a GUI in Perl? 回答1: I toured the various gui modules for Perl recently, and here is my summary (disclaimer: ultimately I found that none of the existing modules met my needs so I started writing my own gui toolkit). Tk - Decent to work with and the interface is very perlish. The gui itself is a bit dated looking, and doesnt take advantage of any of the operating system's native widgets (like filepickers). On

Why is the creation order of widgets important?

↘锁芯ラ 提交于 2019-12-23 03:25:35
问题 The following code works fine. It displays a panedwindow , with a blue box on top and a green box below: panedwindow .root -orient vertical -showhandle true -background red frame .top -background blue -width 100 -height 100 frame .bot -background green -width 100 -height 100 .root add .top .bot pack .root -expand true -fill both However, when I move the panedwindow command down, things stop working. The top, blue box is not shown. Instead, the red of the panedwindow itself shines through: