PyGtk3, How to Put Image to TreeViewColumn's title area? - pygtk

i want add an up/down arrow to TreeViewColumn's title area. but i can only add title. how can i add an arrow image with title to title area.
Thanks.
example:
col = gtk.TreeViewColumn(title = "name", cell)
col.add_image_from_stock(gtk.STOCK_GO_UP)
# or
col = gtk.TreeViewColumn(stock = gtk.STOCK_GO_UP, cell)

col.set_sort_column_id(column_num) this method adds arrow and sorts items when column clicked.

Related

how to drag and drop button to target button in flash

I want to create a button which can be dragged and dropped toward another button so that the button location (x, y) is dragged into the location of the destination button.
My code:
sejarah.onPress = function(){
startDrag(this);}
sejarah.onRelease = function(){
if(this.hitTest (atarget)){
this._x = _root.atarget._x;
this._y = _root.atarget._y;}
else{stopDrag();}
}
I want to achieve this: http://www.thibaud.be/#
on(press) {
startDrag(this);
}
on(release) {
stopDrag();
_x = Math.round(_x/_width)*_width + 0;
_y = Math.round(_y/_height)*_height + 0;
}
This is one of the most simple code that can do a job like this. You put this code inside a button and when you stop dragging this button it's position will snap to the grid.
Your button's clip center must be at top-left corner of button else it can get weird. Also, you can change beginning of grid by changing zeros to position you need.
You can draw a grid to see attachment.

How to remove add to cart button text in the view.phtml

I want to remove add to cart button text only, not the button itself, because I'm using background image instead a text.
I mean the (add to cart)button in the view.phtml Page .
the 'add to cart' text does not reside in view.phtml. you need to go to:
/app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml
and find the code below:
$buttonTitle = $this->__('Add To Cart');
change it to:
$buttonTitle = $this->__('');

Datatables column header not expanding automatically in collapsible panel

I have a datable inside a tab. My application has a left pane and a center pane. Center pane displays the data table and left pane is used for browsing. My left pane is collapsible, but whenever I collapse my left pane the column width in datatables is not automatically re sized based on new width but when I click on any of the column headers it expands / collapse based on the new width. I am not sure how to fix this issue.
I tried using the below code, the table gets expanded properly but the columns are not getting expanded / collapsed unless I click the column headings.
function collapse () {
$("#"+elementId).css('width', '100%');
$("#"+elementId).datatable().fnAdjustColumnSizing();
} );
I figured out that we can use $.fn.dataTable.fnTables(true) to get all the table instances and then adjust the column size of each table.
something like below,
function onCollapse(e) {
var table = $.fn.dataTable.fnTables(true);
if ( table.length > 0 ) {
for(var i=0;i<table.length;i++){
$(table[i]).dataTable().fnAdjustColumnSizing();
}
}
}
Thanks
Barani

changing the color of one cell in a datagrid after grid was startet

I have problems to change one cell of a datagrid after the grid is started. I want to change the colour of some cells and I need to ask if this cell has another value as a cell in another column, and then if this is true to change the colour.
How can i do this?
Try
var rows = dojo.query(".dojoxGridRow", grid.domNode);
var cellsInSecondRow = dojo.query("td", rows[1]);
var cellTwoInSecondRow = = dojo.query("td[idx='1']", rows[1]);
etc..

Robotium ListView with Buttons, can't click on the buttons in the list

I have a dragablelistview with a title and imagebuttons for each item to delete that item.
How do I click on the imageview?
clickInList(int , int) does not work (unless i am doing it wrong?)
Try
clickOnText(String) or clickOnImage(int) clickOnImageButton(int) instead
Try to obtain the view of the list item, something like this :
//get the list view
ListView myList = (ListView)solo.getView(R.id.list);
//get the list element at the position you want
View listElement = myLyst.getChildAt(position);
//click on imageView inside that list element
solo.clickOnView(solo.getView(listEelement.findViewById(R.id.image_button)));