474,040 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkbutton alignment

6 New Member
Hi folks,

I got a checkbutton with a large label which is being wrapped into a few lines.
Due to the height of the label, the checkbutton aligns vertically ending up set on the center of its space.

Is there a way I can set the vertical alignment of the checkbutton so it remains in the top of its space if its label is too big (has many lines)?


Thanks in advance,

Jay
Apr 15 '08 #1
3 2644
jlm699
314 Contributor
Can you tell us what package you're using? (ie, wxPython, Tkinter, etc...)
Also a very concise example would help us to see what it is that you're having trouble with.
Apr 15 '08 #2
jayro
6 New Member
Hi,

oops, sorry.. I forgot to say which toolkit I am using.

It is pyGTK.

Thanks,
Apr 15 '08 #3
jayro
6 New Member
Here's an example.
As you can see when you run the code, the checkbutton stays aligned vertically to the center of its space.
Can anyone help? thanks

#!/usr/bin/env python

import pygtk
pygtk.require(' 2.0')
import gtk

class Base:
def __init__(self):
self.window = gtk.Window(gtk. WINDOW_TOPLEVEL )
self.window.sho w()
self.checkbox = gtk.CheckButton ("lalalaaskjans najksansjkasnjk ansajksnajksnaj nsajknsjkasna\n ajnsajksnaksnan jksajksnas\njka bnsjkansjkanas\ najibsajksa")
self.window.add (self.checkbox)
self.checkbox.s how()
def main(self):
gtk.main()
if __name__ == "__main__":
base = Base()
base.main()
Screenshots:
Here's what I got:



Here's what I want (GIMP helped me on this):

Apr 16 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3243
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
1
3268
by: Elaine Jackson | last post by:
My CheckButton variables seem always to be true, whether the box is checked or not, which makes them considerably less useful. Following is a little script that illustrates the difficulty. Any help will be greatly appreciated. Thank you. ########################################### from Tkinter import * def bCommand():
3
7671
by: Tuvas | last post by:
I want to have a checkbutton that when it is pushed will do a function depending on if it was pushed before or not. Ei: b=checkbutton(command=check) b.grid(row=0,column=0) def check(): if (b.value==0): do_stuff_here() elif(b.value==1)
67
10864
by: S.Tobias | last post by:
I would like to check if I understand the following excerpt correctly: 6.2.5#26 (Types): All pointers to structure types shall have the same representation and alignment requirements as each other. All pointers to union types shall have the same representation and alignment requirements as each other. Does it mean that *all* structure (or union) types have the same alignment? Eg. type
2
2557
by: Muleskinner | last post by:
Hi group, One simple question: How to create a checkbutton in vb.net? In vb6.0 it was easily done by changing the style of the checkbox control, but how to do it in vb.net... Regards Thomas
3
2169
by: Thomas Jansson | last post by:
Dear all I am writing a program with tkinter where I have to create a lot of checkbuttons. They should have the same format but should have different names. My intention is to run the functions and the create all the buttons with the names from the list. I now the lines below doesn't work, but this is what I have so far. I don't really know how call the element in the dict use in the for loop. I tried to call +'item'+ but this doesn't...
16
2112
by: Giovanni D'Ascola | last post by:
Hi. I noticed that <input type="reset"actually don't enable checkbutton which are checked by default after they have been disabled by javascript. It's a bug?
0
866
by: dudeja.rajat | last post by:
Hi, I've a checkbutton in my GUI application which I want to work as: 1. it should be un-ticked by default, 2. should display a label in Gui, by default, 3. when user ticks the check button this should the above label goes off the screen and not longer is displayed.
0
927
by: Gabriel Genellina | last post by:
En Thu, 21 Aug 2008 05:07:45 -0300, <dudeja.rajat@gmail.comescribi�: Use the grid_forget method to hide the label. Based on your posted example: from Tkinter import * def onclick(): if varTestAll.get(): lblVersionUnderTest.grid_forget() else: lblVersionUnderTest.grid(row=2, column=1)
0
10536
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10333
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
11137
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
10301
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8687
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4936
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3958
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.