I'm working on a Python+Gtk3 application with a fancy-looking GtkTreeView:
This is great for sighted users, but here's what Orca (the screen reader) says for a row in that tree view:
"Image, Devhelp, Collapsed, 9.2 MB"
A few problems, of course. First, it doesn't mention the checkbox for each row because I'm packing three cell renderers into a column. The three are available, but for some reason Orca doesn't mention the checkbox when it's buried that deep. Meanwhile, the image it mentions is the one on the far left, which is usually empty but sometimes a "restart required" indicator. Naturally, a blind user, much like a sighted user, couldn't care less that it is an image.
What I would like to do is to poke at the accessibility objects that describe this table in order to make them a little more helpful. Using Accerciser, I can see that these exist, but they all seem to be implemented with private, undocumented classes (like GtkTreeViewAccessible), and they don't look terribly extensible, but I'm hoping I'm wrong. Knowing that the treeview's accessible object is an AtkTable at some level, I did the following to set an accessible description for the image cell in the Backup row:
access = self.treeview_update.get_accessible()
cell_access = access.ref_at(0,0)
cell_access.set_image_description("Requires system restart")
(Orca still says "Image" after speaking the description, but I'll assume it knows what it's doing).
However, that code isn't very nice. When I call access.ref_at, I'm making particular assumptions about how GTK is mapping cell positions to rows and columns in the ATK object. I'm also limited to calling that when I first populate the tree, and I'm not sure if that is particularly sane.
So there's my problem: I would like to add accessible descriptions for my tree view cells in a nice way that won't break unexpectedly. How can I do that?
Related
I inherited a Kentico 11-managed site, and taking care of it is only a small part of my responsibilities, so I'm far from being a Kentico expert even though it's been a year and a half. The site (there is only one) includes a custom Page type called Publication. The original developers created a Smart Search index on this type, which has always seemed to work fine. But there is one particular instance (at least - there could be others we haven't noticed, but as far as we've seen it's just this one) that simply does not show up in Smart Search results. If we enter any substring of its title, or even the full, exact title, as a search term, it just does not appear in the results. Other pages of the type appear as the first or second result in those circumstances.
We've tried rebuilding the index several times, and unpublishing and republishing the page, and I've compared its row in the custom table to others that are very similar, and have found nothing to explain why this might be happening. The Form and Metadata properties are identical to those of instances that are normally searchable. Where else ought we to look for a possible explanation? What might be causing just this one instance to fail to be indexed?
I'm a bit new to GMS2 and am having a bit of a problem.
In the current state of my game, you start in a useless room that only exists to initialize global variables and a persistent object. This room then switches to an actual level. All of this occurs in the creation code of the first room:
globalVars();
instance_create_depth(-2*global.tile_size, -2*global.tile_size, 0, OBJ_UTIL_manager);
room_goto(2);
Upon switching rooms, only some of the instances appear. In particular, only objects without a parent or with one certain parent appear. Objects with another type of parent do not appear. They are present in the room builder. They DO exist, but are invisible.
The same room, if moved to the top of the room queue and therefore being the first room created, works just fine as long as I add the above global variable initialization and manager object creation. Is there anything special that must be done when switching rooms to make things visible?
This is how the room appears in the editor: http://prntscr.com/lg2x3w
Compared to how it appears upon being switched to: http://prntscr.com/lg2wdg
I do not know the full detail of the problem, but I did have a similar issue, so I can tell you a solution without actually knowing what went wrong, but anyways hope it helps.
Firstly, use the instance_create_layer instead of instance_create_depth and make sure that these layers where you create your objects exist in both the first "fake" room and the actual room.
secondly, make sure you do not have any code that change the depth/layer in the create event. [again I do not know why this could cause an issue, but it did cause an issue to me, so maybe you have the same issue/solution]
Lets say I have three webpages - one for big cars, one for middle sized cars, and one for little cars.
Each page is almost identical and consists of a form where you can select to filter a list of cars by colour etc and a submit button. On the client side the only difference is the title.
On the server side the only difference is in the where clause, for example:
... where car_type = "big" and color = %s, Response.Form['color']
But how can I save myself creating three different asp scripts for each page? How do I pass around which car_type I have?
I was thinking maybe by using a query string, but the query string data will be lost when the user presses the submit button.
Thanks,
Barry
You've found one solution yourself. Might not be the best one, though. When programming you always want to minimize redundancy, to avoid code duplication, because it'll invariably become a maintenance hassle, if not nightmare. So you really want to avoid creating three identical pages with just a tiny parameter difference.
Why don't you simply create one single page containing a select menu for the type of vehicle to search for? You could attach an onselect handler using Javascript to that menu which would reload the page if that's necessary. (And it might not even be.) In some menu, you could have links pointing to this page (search.asp or whatever) containing the vehicle type like this:
search.asp?type=L
search.asp?type=M
search.asp?type=S
Just an idea. Toy around with the code and that way you'll learn a lot. ASP is an old technology but I think a very good one for learning web applications. Do read the docs to learn about the facilities it affords you to avoid duplicating code. Here's a collection of things I found useful.
One way to do this is to use the query string the first time the page is accessed and then a hidden field to pass on the car type on filtering.
What I'm trying to do is have a 3 state tree expansion.
I have three different icons for "expand" "collapse" "semi-expanded" which I want to use to show a partially populated tree control with all nodes initialized to semi-expanded state and then on clicking the "semi-expanded" icon it gets data from server and populates the tree and open that branch with "expanded" icon.
I tried looking for it but couldn't find anything close to it except the 3-state checkbox but don't know how to use it on 3 state icon when tree would only maintain 2 states.
Thanks in advance.
I think what you are looking for is called a lazy-loading tree. There are lots of examples your can google for, but here is a great example.
As far as the visual part of your request goes (3 different icons to show that state of the branch or node) - you could easily handle that with a custom renderer, by looking at a flag on the node for it's load status.
Does that help?
A 3-State tree control is a bit uncommon and might therefore be a bit confusing; consider that even simple 3-state checkboxes are relatively rare and users may not be accustomed to them. Maybe that's why you didn't find such a tree control.
Thus, maybe you should consider using an alternate design that doesn't require 3-state controls.
For example, the node could start in collapsed node. If the user expands it, and there is no data yet, show a single sub node with the text "retrieving data..." (and a progress wheel or other progress indicator, if you can) and start data retrieval. When the data arrives, replace this sub node with the actual data.
its said that 1 ViewModel has 1 View.
1 View is for me a UserControl. What if my UserControl has different areas filled with data from different entities, do I have then several Views and need to build several ViewModels?
e.g: I display in a UserControl 3 entities: customer(listbox),order(datagrid),product(datagrid). Each of those "data areas" has add+remove buttons and textboxes to enter data.
Actually each of those "data areas" are put in its own GRID having so the posibility to set a individual datacontext.
1.) Should I now create 3 ViewModels CustomerVM,OrderVM and ProductVM?
2.) Are those 3 "data areas" seen as an own sort of separated View, although I have not put them in 3 UserControls.xaml files ???
3.) When this one UserControl is inside a TabControl`s tabpage where do I load the 3 entities related data? Inside the MainViewModel? I want to show/load that data only when the user clicks the tabheader.
No, you can do all that in the one viewmodel. The job of the viewmodel is to hold the data for the view, and if necessary transform that data so the view can consume it. There is nothing that says a viewmodel has to hold specific types of information, i.e. there are no rules that state "it may only hold customer info and not order info".
Having said that, there is also no reason why the viewmodel cannot be consumed by several different views (give them all different instances, of course) - this would show that you have a good separation of concerns between your views and viewmodel. Personally, i code my viewmodels so that they have no idea that the view exists. There is also no reason why the view has to consume everything that the viewmodel exposes, although binding a CustomerView to a CustomerOrderProductViewModel is going a little too far.
Edit: let me explain that last paragraph a little more.
Example 1: i have a new V which shows customer information, and i have an existing VM which has customer info AND order info
I would be reluctant to use this VM for this V, because while it does have the client info i need, it has too much info - i'm using the VM out of the context is was originally intended for.
Example 2: i have a VM that contains full client info, like their postal and residential address, their phone numbers, their girlfriend's names*, and a bunch of other client type info. I have a V which shows the client's name, birthday, and maybe two other properties.
I would consider using that VM for that V, this illustrates my point that the V doesn't have to show all the info contained within the VM. This concept becomes more apparent when you change the V (as in, do some maintenance and change the UI of the view, because someone has decided that they want a bunch of fields removed and now they want to represent the client's age as an image) - i can still use the same VM, and just change the V (i could use a ValueConverter to represent the age as an image, thus avoiding a change to the VM).
At what point would i stop using the current ClientViewModel, and write a new one that was more specific to the needs of the modified ClientView?
There is no clear cut answer to that - it depends on the amount of time i have available to do the changes, the amount of time available for testing, and the trade-off in complexity between using a full blown Client object for the VM, and writing a new leaner version of the Client object while still retaining the old one.
*that should be a collection of independant objects incorporated in the client object, but just work with me here it's a made up example :)