Questions tagged [readonly-attribute]
126 questions
1
vote
1 answer
How do I make all instance variables of a class readonly?
Let's say I have a class like the following:
class Test:
def __init__(self, some_data_source):
self.a = 5
self.b = some_data_source['c']
I want to make all instance variables of this class read-only and will use it as…

Arnav Borborah
- 11,357
- 8
- 43
- 88
1
vote
1 answer
Having a input readonly i cannot copy value
I'm having trouble with input text that are readonly and have a placholder text.
I cannot copy the text in chrome.
If the text is selected with the mouse and then CTRL + C, the text is not copied
If the text is double-clicked and then CTRL + C, the…

Mlk Luis Esprança
- 11
- 1
- 3
1
vote
2 answers
How to create a public directory on the external storage?
I am trying to save public files on the external storage.
I am following the example from Android Developers page:
https://developer.android.com/training/data-storage/files#PublicFiles
First I tried to create a directory "mydocuments" in the…

amarougr
- 11
- 1
- 4
1
vote
0 answers
WPF Microsoft DataGrid has weird "IsReadOnly" behavior. Why?
Using only one DataGrid is fine.
But in my sample code, I defined a checkbox (top left of window) to switch state of ReadOnly property of DataGrids that are in ListView items.
ReadOnly state of ListView DataGrids are changing but there is side…

Eric Ouellet
- 10,996
- 11
- 84
- 119
1
vote
1 answer
Create first-class object all of it's instance attributes are readonly like slice?
My question is how to create a class like slice?
slice (built-in type) doesn't have a __dict__ attribute
even that the metaclass of this slice is type.
And it is not using __slots__, and all it's attribute are readonly and it's not…

Charif DZ
- 14,415
- 3
- 21
- 40
1
vote
0 answers
How add a global "IsReadOnly" style to all DataGridTextColumns
I currently have a ResourceDictionary file for my WPF application, which pretty much adds every style that I could possibly want throughout all of my application's DataGrids.
Except one.
How can I add a global "IsReadOnly" setter, for all of my…

Mike Gledhill
- 27,846
- 7
- 149
- 159
1
vote
2 answers
When using HTML and CSS, how can I apply a class to a field that is already read-only?
Here's my dilemma: I have jQuery code with an if-statement that applies a specific class to an element based on the value selected on a page where the user is filling out a form. I also built another form where a user can view the details of a…

Cory
- 29
- 3
1
vote
3 answers
Pythonic approach to internal API for strings
Question
Is there a "pythonic" (i.e. canonical, official, PEP8-approved, etc) way to re-use string literals in python internal (and external) APIs?
Background
For example, I'm working with some (inconsistent) JSON-handling code (thousands of lines)…

Cloud
- 18,753
- 15
- 79
- 153
1
vote
1 answer
Make all fields in an interface readonly in a nested way
I know that, we can use Readonly< T> to redeclare all fields of T as readonly, as in: [Typescript: extending an interface and redeclaring the existing fields as readonly
What about nested fields? For example:
interface School {
teachers:…

Yavuz Mester
- 357
- 4
- 11
1
vote
2 answers
WPF datagrid IsReadOnly exception
I have a datagrid where i have added a Checkbox column. I want the entire datagrid to be IsReadOnly except the Checkbox column. I have tried:

PuchuKing33
- 381
- 3
- 7
- 19
1
vote
1 answer
Setting NSView readonly-property tag on subclass
I have a class derived from NSView. NSView has a declaration
@property (readonly) NSInteger tag;
How can I set tag property to some value in my subclass? I tried following in my header file
@property(readwrite, assign) NSInteger tag;
Then in…

superg
- 379
- 1
- 6
- 19
1
vote
0 answers
Derby Embedded Database on Readonly File Properties
Im using Java Netbeans 7.0 for my POS System , I already created an Installer or .exe of it using Derby Embedded database.
My Problem is When im installing it to other PC in said that there is a problem on SQL database that is not permitted for a…

El Jei-Tulio Del Rio
- 11
- 3
1
vote
1 answer
Appended text not showing in textarea when toggling readonly or disabled attributes
I have a textarea that I would like to be either disabled or readonly. I use buttons on my site to append text to that textarea to take notes. The purpose of not allowing edits is so that no one can accidentally change any notes.
Now, if someone…

fiddlestacks
- 109
- 1
- 10
1
vote
3 answers
PropertyGrid - Dynamically changing ReadOnlyAttribute
Sigh, another PropertyGrid question. I thought I could get around this until I ran into a problem where I couldn't actually avoid it.
I have a boolean property that sometimes needs to be read-only and sometimes needs to be changeable depending on…

Eric Smith
- 2,329
- 2
- 23
- 30
0
votes
1 answer
How to hide Popup fields or display them as read only in MobiScroll using React
I trying to find out how we can conditionally hide fields, or set them to be read-only, in Mobiscoll using React. If anyone could share an example of how to do this I would be most grateful.
In the following code that is returned in an index.tsx…

Alistair
- 1