精华内容
下载资源
问答
  • Toplevel

    2011-06-12 11:31:00
    option add *MessageInfo.title "Notice" widgetDefault class MessageInfo { inherit itk::Toplevel constructor {args} { itk_component add dismiss { button $itk_interior.dismiss ...

    option add *MessageInfo.title "Notice" widgetDefault

    class MessageInfo {
        inherit itk::Toplevel

        constructor {args} {
            itk_component add dismiss {
                button $itk_interior.dismiss -text "Dismiss" -command "destroy $itk_component(hull)"
            }
            pack $itk_component(dismiss) -side bottom -pady 4

            itk_component add separator {
                frame $itk_interior.sep -height 2 -borderwidth 1 -relief sunken
            }
            pack $itk_component(separator) -side bottom -fill x -padx 4

            itk_component add icon {
                label $itk_interior.icon -bitmap info
            }
            pack $itk_component(icon) -side left -padx 8 -pady 8

            itk_component add infoFrame {
                frame $itk_interior.info
            }
            pack $itk_component(infoFrame) -side left -expand yes \
                -fill both -padx 4 -pady 4

            itk_component add message {
                label $itk_interior.mesg -width 20
            } {
                usual
                rename -text -message message Text
            }
            pack $itk_component(message) -expand yes -fill both

            eval itk_initialize $args

            after idle [code $this centerOnScreen]
        }

        protected method centerOnScreen {} {
            update idletasks
            set wd [winfo reqwidth $itk_component(hull)]
            set ht [winfo reqheight $itk_component(hull)]
            set x [expr ([winfo screenwidth $itk_component(hull)]-$wd)/2]
            set y [expr ([winfo screenheight $itk_component(hull)]-$ht)/2]
            wm geometry $itk_component(hull) +$x+$y
        }
    }

    usual MessageInfo {
        keep -background -cursor -foreground -font
        keep -activebackground -activeforeground -disabledforeground
        keep -highlightcolor -highlightthickness
    }

    #
    # EXAMPLE:  Create a notice window:
    #
    MessageInfo .m -message "File not found:n/usr/local/bin/foo"

    转载于:https://www.cnblogs.com/greencolor/archive/2011/06/12/2078791.html

    展开全文
  • Top level tags

    2020-12-01 19:18:52
    for drf-spectacular schema, because it doesnt have tags at the top level. <p>An example with tags in the top level can be seen on 1. https://dhcode.github.io/openapi-ui/ 2. Select USPTO v3 3. Notice ...
  • Toplevel distcheck

    2020-12-29 07:10:36
    <div><p>make distcheck work at toplevel. depends on #361. <p>also, include the travis batch file into the check target - extend the scope of travis checks to "distcheck" - simplify travis ...
  • Toplevel propagator

    2020-12-25 18:05:28
    <div><p>This adds a basic toplevel-propagation functionality. It propagates definitions of the form: <ul><li> <p>variable = constant </li><li> <p>variable = variable </li><li> <p>constant =...
  • Top level class

    2020-12-02 12:13:35
    <p>Has a top level EndDash class, that is the Queen/King of the castle (EndDash code) It decouples the require system from EndDash, HTML in script tags of type EndDash can be loaded into EndDash by ...
  • Top level links

    2020-12-02 15:14:07
    <div><p>Support creation of the top level links hash. <p>I think this should be done in the <code>setup</code> of the <code>request</code> object and provided to the <code>serializer</code> in the ...
  • Tkinter Toplevel

    2019-10-05 07:56:34
    Tkinter Toplevel:顶层部件的工作,直接由窗口管理器管理的窗口。他们不必在它们上面的父widget 顶层部件的工作,直接由窗口管理器管理的窗口。他们不必在它们上面的父widget. 你的应用程序可以使用任意...
       Tkinter Toplevel:顶层部件的工作,直接由窗口管理器管理的窗口。他们不必在它们上面的父widget
     
    顶层部件的工作,直接由窗口管理器管理的窗口。他们不必在它们上面的父widget.

    你的应用程序可以使用任意数量的顶层窗口.

    语法:

    这里是一个简单的语法来创建这个widget:

    w = Toplevel ( option, ... )
    

    参数:

    • options: 下面是这个小工具最常用的选项列表。这些选项可以作为键 - 值对以逗号分隔.

    OptionDescription
    bg The background color of the window.
    bd Border width in pixels; default is 0.
    cursor The cursor that appears when the mouse is in this window.
    class_ Normally, text selected within a text widget is exported to be the selection in the window manager. Set exportselection=0 if you don't want that behavior.
    font The default font for text inserted into the widget.
    fg The color used for text (and bitmaps) within the widget. You can change the color for tagged regions; this option is just the default.
    height Window height.
    relief Normally, a top-level window will have no 3-d borders around it. To get a shaded border, set the bd option larger that its default value of zero, and set the relief option to one of the constants.
    width The desired width of the window.

    方法:

    量表的对象有这些方法:

    Methods & Description
    deiconify()
    Displays the window, after using either the iconify or the withdraw methods.
    frame()
    Returns a system-specific window identifier.
    group(window)
    Adds the window to the window group administered by the given window.
    iconify()
    Turns the window into an icon, without destroying it.
    protocol(name, function)
    Registers a function as a callback which will be called for the given protocol.
    iconify()
    Turns the window into an icon, without destroying it.
    state()
    Returns the current state of the window. Possible values are normal, iconic, withdrawn, and icon.
    transient([master])
    Turns the window into a temporary(transient) window for the given master, or to the window's parent, when no argument is given.
    withdraw()
    Removes the window from the screen, without destroying it.
    maxsize(width, height)
    Defines the maximum size for this window.
    minsize(width, height)
    Defines the minimum size for this window.
    positionfrom(who)
    Defines the position controller.
    resizable(width, height)
    Defines the resize flags, which control whether the window can be resized.
    sizefrom(who)
    Defines the size controller.
    title(string)
    Defines the window title.

    例子:

    自行尝试下面的例子:

    from Tkinter import *
    
    root = Tk()
    top = Toplevel()
    
    top.mainloop()
    

    这将产生以下结果:

     

    转载于:https://www.cnblogs.com/tkinter/p/5628832.html

    展开全文
  • Top level route configs

    2020-12-26 04:32:20
    <div><p>Right now in Angular 1, the top level controller must be named "AppController," or the config attached to <code>AppController.$routeConfig</code> will not be present. <p>It would be ...
  • improve top level docs

    2021-01-07 14:05:13
    <div><p>improve the top level documentation</p><p>该提问来源于开源项目:crate/crate</p></div>
  • Toplevel .gemspec

    2020-12-09 12:34:47
    <div><p>Provide a toplevel gemspec (extracted from Rakefile) for Bundler friendliness.</p><p>该提问来源于开源项目:rubys/nokogumbo</p></div>
  • Top level bar redesign

    2020-12-08 22:13:12
    I would rather have some top level items, and then maybe some in dropdown, like this console (at the bottom in this case): <p><img alt="1_ha" src=...
  • Top level menu overlaps

    2020-12-05 18:25:10
    <div><p>The top level menu items overlaps with other UI elements when the screen is resized down.</p><p>该提问来源于开源项目:sabeechen/hassio-google-drive-backup</p></div>
  • Show Top Level in Library

    2020-12-08 20:07:47
    <div><p>Please add the top level of a certain species, instead of only the percentual difference of the level of a single dino of that species to its top level. Many people I know (and myself included...
  • Toplevel(顶级窗口)组件类似于 Frame 组件,但 Toplevel 组件是一个独立的顶级窗口,这种窗口通常拥有标题栏、边框等部件,和 Tk() 创建出来的根窗口是一样的,共享着一样的方法。 目录 何时使用Toplevel组件? ...

    Toplevel(顶级窗口)组件类似于 Frame 组件,但 Toplevel 组件是一个独立的顶级窗口,这种窗口通常拥有标题栏、边框等部件,和 Tk() 创建出来的根窗口是一样的,共享着一样的方法。

    目录

    何时使用Toplevel组件?

    Tk(根窗口)和Toplevel(顶级窗口)的方法

    attribute(*args)之args参数


     

    何时使用 Toplevel 组件?

    Toplevel 组件通常用在显示额外的窗口、对话框或者其他弹出窗口上。


    下面的例子,我们在 root 窗口添加一个按钮用于创建一个顶级窗口,点一下来一个。

    from tkinter import *
    
    root = Tk()
    
    def create():
        top = Toplevel()
        top.title('Python')
    
        msg = Message(top, text='I love study')
        msg.pack()
    
    Button(root, text='创建顶级窗口', command=create).pack()
    
    mainloop()

     

     

    Tk(根窗口)和Toplevel(顶级窗口)的方法

    下边这一系列方法用于与窗口管理器进行交互。他们可以被Tk(根窗口)调用,同时也适用于Toplevel(顶级窗口)。

    注意:并非所有操作系统均完全支持下方所有方法的实现。

    方法 含义
    aspect(minNumber=None, minDenom=None, maxNumber=None, maxDenom=None,)

    --控制该窗口的宽高比(width:height)

    --宽高比限制在:minNumber/minDenom~maxNumber/maxDenom

    --如果忽略参数,则返回一个4元组表示当前的限制(如果有的话)

    attributes(*args)

    --设置和获取窗口属性

    --如果你只给出选项名,将返回当前窗口该选项的值

    --注意:以下选项不支持关键字参数,你需要在选项前加横岗(-)并用字符串的方式表示,用逗号(,)隔开选项和值。(博主注:此处的哪些选项不支持可能当时忘写了,记得这里是在哪里出现的可以在评论里留下视频链接和具体时长,我回头加上)

    --例如你希望设置窗口的透明度为50%,你应该使用attributes("-alpha", 0.5)代替 attributes(alpha=0.5)

    -- args选项列表见文末

    client(name=None)

    --设置和获取WM_CLIENT_MACHINE属性

    --如果要删除WM_CLIENT_MACHINE属性,赋值为空字符串即可

    --该属性仅支持X窗口系统的窗口管理器,其他系统均忽略

    colormapwindows(*wlist)

    --设置和获取WM_COLORMAP_WINDOWS属性

    --该属性仅支持X窗口系统的窗口管理器,其他系统均忽略

    command(value=None)

    --设置和获取WM_COMMAND属性

    --该属性仅支持X窗口系统的窗口管理器,其他系统均忽略

    deiconify()

    --显示窗口

    --默认情况下新创建的窗口都会显示在屏幕上,但是用iconify()或withdraw()方法可以在屏幕上移除窗口

    focusmodel(model=None) --设置和获取焦点模式
    frame()

    --返回一个字符串表示当前系统特征

    --对于类Unix系统,返回值是X窗口标识符

    --对于Windows系统,返回值是HWND强制转换为长整形的结果

    geometry(geometry=None)

    --设置和获取窗口的尺寸

    --geometry的参数格式为:"%dx%d%+d%+d"%(width, height, xoffset, yoffset)

    (wm_)grid(baseWidth=None, baseHeight=None, widthInc=None, heightInc=None)

    --通知窗口管理器该窗口将以网格的形式重新调整尺寸

    --baseWidth和baseHeight指定Tk_GeometryRequest要求的网格单元数

    --widthInc和heightInc指定单元的高度和宽度

    (wm_)group(window=None)

    --将窗口添加到窗口群中

    --window参数指定控制窗口群的主窗口

    --如果忽略该选项,将返回当前窗口群的主窗口

    (wm_)iconbitmap(bitmap=None, default=None)

    --设置和获取窗口的图标

    --例如root.iconbitmap(bitmap="python.ico")

    --default参数可以用于指定由该窗口创建的子窗口的默认图标

    (wm_)iconify()

    --将窗口图标化(最小化)

    --需要重新显示窗口,用deiconify()方法

    --该方法会使得state()返回"iconic"

    (wm_)iconmask(bitmap=None) --设置和获取位图编码
    (wm_)iconname(newName=None) --设置和获取当前窗口图标化(最小化)时的图标名字
    (wm_)iconposition(x=None, y=None) --设置和获取当前窗口图标化(最小化)时的图标位置
    (wm_)iconwindow(pathName=None)

    --设置和获取当前窗口图标化(最小化)时的组件窗口

    --该方法会使得state()返回“icon”

    (wm_)maxsize(width=None, height=None) --设置和获取该窗口的最大尺寸
    (wm_)minsize(width=None, height=None) --设置和获取该窗口的最小尺寸
    (wm_)overrideredirect(boolean=None) --如果参数为True,该窗口忽略所有的小部件(也就是说该窗口将没有传统的标题栏、边框等部件)
    (wm_)positionfrom(who=None)

    --指定窗口位置由“谁决定

    --如果who参数是“user”,窗口位置由用户决定

    --如果who参数是“program”,窗口位置由系统决定

    (wm_)protocol(name=None, func=None)

    --将回调函数func与相应的规则name绑定

    --name参数可以是“WM_DELETE_WINDOW”:窗口被关闭的时候

    --name参数可以是“WM_SAVE_YOURSELF”:窗口被保存的时候

    --name参数可以是“WM_TAKE_FOCUS”:窗口获得焦点的时候

    (wm_)resizable(width=None, height=None)

    --指定是否可以改变该窗口的尺寸

    --width为True说明允许调整窗口的水平尺寸

    --height为True说明允许调整窗口的垂直尺寸

    (wm_)sizefrom(who=None)

    --指定窗口尺寸由“谁决定

    --如果who参数是“user”,窗口尺寸由用户决定

    --如果who参数是“program”,窗口尺寸由系统决定

    (wm_)state(newstate=None)

    --设置和获得当前窗口的状态

    --newstate的只可以是'normal', 'iconoc'(见iconify), 'withdraw'(见withdraw), 'icon'(见iconwindow)和'zoomed'(放大,Windows特有)

    (wm_)title(string=None) --设置窗口的标题
    (wm_)transient(master=None) --指定为master的临时窗口
    (wm_)withdraw()

    --将窗口从屏幕上移除(并没有销毁)

    --需要重新显示窗口,使用deiconify()方法

    --该方法会使得state()返回"withdraw"

    wm_aspect(minNumber=None, minDenom=None, maxNumber=None, manDenom=None) --见上方aspect()
    wm_attributes(*args) --见上方attributes()

    wm_client(name=None)

    --见上方client()
    wm_colormapwindows(*wlist) --见上方colormapwindows()
    wm_command(value=None) --见上方command()
    wm_deiconify() --见上方deiconify()
    wm_focusmodel(model=None) --见上方focusmodel()
    wm_frame() --见上方frame()
    wm_geometry(geometry=None) --见上方geometry()

     

    attributes(*args) 之 args 参数

    选项 含义
    alpha

    (Windows,Mac)控制窗口的透明度

    1.0表示不透明,0.0表示完全透明

    该选项并不支持所有的系统,对于不支持的系统,Tkinter绘制一个不透明(1.0)的窗口

    disabled (Windows)禁用整个窗口(这时候你只能从任务管理器中关闭它)
    fullscreen (Windows,Mac)如果设置为True,则全屏显示窗口
    modified (Mac)如果设置为True,该窗口被标记为改动过
    titlepath (Mac)设置窗口代理图标的路径
    toolwindow (Windows)如果设置为True,该窗口采用工具窗口的样式
    topmost (Windows,Mac)如果设置为True,该窗口将永远置顶

     

    下例实现了根窗口全屏并且半透明,以及顶级窗口半透明。

    from tkinter import *
     
    root = Tk()
    
    root.attributes("-alpha", 0.5, "-fullscreen", True)
    
    def create():
        top = Toplevel()
        top.title('Python')
        top.attributes("-alpha", 0.5)
     
        msg = Message(top, text='I love study')
        msg.pack()
     
    Button(root, text='创建顶级窗口', command=create).pack()
     
    mainloop()
    

     

     

     

     

    展开全文
  • Support top level statements

    2020-11-28 04:17:42
    be compiled.</li><li>These top level statements are taken into <strong>init</strong>. Then the <strong>init</strong> is loaded into the cxx boost.</li></ul>该提问来源于开源项目:serge-sans-...
  • Toplevel pages only

    2020-12-02 00:25:11
    <div><p>This plugins generates a sitemap just fine, but for toplevel pages only. Any directories down seem to be entirely ignored. Is this by design? If not, then I may have found a bug. <p>I tried ...
  • Include top level directory

    2020-12-25 22:17:50
    <p>It would like to suggest including a top level directory for the javascript files. At the moment one has to import "lang-all.js" and "gcal.js". Those names seem more common than &#...
  • xdg shell toplevel

    2020-11-28 17:49:43
    <div><p>In this PR I want to flesh out the xdg shell toplevel. <p>We can use this as a basis to decide the abstractions for the other shells and what interface is provided to the user. <p>Our shell ...
  • Python中Toplevel

    千次阅读 2019-02-18 13:17:52
    Toplevel(顶级窗口),类似于弹出窗口,具有独立的窗口属性(如标题栏、边框等) 下边的例子中,在root窗口添加一个按钮,点一下弹出一个顶级窗口。 from tkinter import * root = Tk() def create(): #创建一个...

    Toplevel(顶级窗口),类似于弹出窗口,具有独立的窗口属性(如标题栏、边框等)
    下边的例子中,在root窗口添加一个按钮,点一下弹出一个顶级窗口。

    from tkinter import *
    root = Tk()
    def create():
    #创建一个顶级弹窗
        top = Toplevel()
        top.title('我的弹窗')
       # top.attributes('-alpha',0.5)这个可以设置弹出窗口的透明度
        msg = Message(top,text = '类似于弹出窗口,具有独立的窗口属性。',width = 150)
        msg.pack()
    Button(root,text = '创建一个顶级窗口',command = create).pack(padx = 20,pady = 50)
    mainloop()
    

    此问题是我在开发过程中遇到的实际问题,在主窗口中弹出子窗口,想获取子窗口中的entry数据,在测试中代码正确,但是当我封装好函数后,却老是出错。。。。。原因在于线程问题,toplevel完美解决

    展开全文
  • <div><p>In the default Xsd there is support for just one top-level ... I'd like to extend that to support multiple top-level nodes. There would still be the need for children, but want to have more ...
  • Add OCaml toplevel support

    2020-12-09 07:21:21
    <div><p>Like <a href="https://github.com/ocaml/tuareg">tuareg</a> or <a href="https://github.com/nbros/OcaIDE/blob/master/Ocaml.help/docs/tools/toplevel....hackwaly/vscode-ocaml</p></div>
  • <div><p>if I change top level category I get error: A node cannot be moved to a descendant of itself." on line 1028 of /var/...
  • Right clicking a folder lets me create a subdirectory and right clicking a top level file does not give an option to create a folder. <p>Looking through previously closed issues, it looks like one is...
  • <div><p>This is a first step towards better handling of top-level objects <ul><li>Split declaration.Enum/Structure to EnumContract/EnumToplevel (same for structure)</li><li>Remove the placeholder top ...
  • toplevel.as

    2011-08-11 11:25:00
    flash场景测试时提示找不到toplevel.as
  • Allow sources at top level

    2020-12-09 14:19:46
    <p>The current implementation ignores toplevel test directories (like <code>test) so that <code>yotta test</code> can still be used with these modules.</p><p>该提问来源于开源项目:ARMmbed/yotta...
  • <div><p>This fixes the ...<p>Also added simple logic which filters the keywords which can be used with unsafe on the top level. </p><p>该提问来源于开源项目:rust-analyzer/rust-analyzer</p></div>
  • <p>Any way we can get a release of the this gem with the top level array response functionality? <p>Or is there a hot fix I can implement in v1.2.1 that could get me this?</p><p>该提问来源于开源项目&#...
  • <div><p>It seems that top level module level comments don't appear if the module also has imports. <pre><code> /** * <our copyright here> */ import * as _ from "lodash"; </our>...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 29,470
精华内容 11,788
关键字:

toplevel